ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Extra mouse buttons combo

(1/1)

kartal:
Hi

I tried to post on Ahk forums but I could not get any real help. I am hoping that Dc coders can crack this for bonus donation credits :)

What I am trying to do is,

-Xbutton1+Xbutton2=c key (sends c key)

-Xbutton1=Ctrl (when not in combo mode)

-Xbutton2=Shift  (when not in combo mode)



Here is the code I am using at the moment. But the problem is that I loose the functionality of Xbutton1. Everything works except Xbutton1 as individual button.




~XButton1 & ~XButton2::Send c

XButton2::Send {Shift Down}
XButton2 Up::Send {Shift Up}
XButton1::Send {Ctrl Down}
XButton1 Up::Send {Ctrl Up}

computerfritze:
I think you canĀ“t press 2 buttons at the same Time.

skrommel:
 :) Try tweaking this script.

Skrommel


--- ---;TwoHotkeys.ahk
;Skrommel @ 2008

button1=XButton1
button2=XBUtton2

Hotkey,*%button1%,BUTTON1DOWN
Hotkey,*%button1% Up,BUTTON1UP
Hotkey,*%button2%,BUTTON2DOWN
Hotkey,*%button2% Up,BUTTON2UP
active=0
Return

BUTTON1DOWN:
active+=1
ToolTip,%active%
Return

BUTTON1UP:
If active=1
  Send,1
If active=3
  Send,3
ToolTip,%active%
active=0
Return

BUTTON2DOWN:
active+=2
ToolTip,%active%
Return

BUTTON2UP:
If active=2
  Send,2
If active=3
  Send,4
ToolTip,%active%
active=0
Return

Esc::
ExitApp

kartal:
Hi Skrommel,

thanks for the script. It looks like it has the idea. It successfully simulates and distinguish those buttons.  But before getting into hacking I should mention that XButton1 and xButton2 will be "ctrl" and "shift" modifiers. And during the usage I would keep them pressed to simulate a pressed down shift or ctrl. One common problem with simulating shift or ctrl via scripts is that they stay stuck even after releasing the hosting key.  Do you think that your script can successfully simulate shift keys? Otherwise I might need to add shift pressed and release stuff which might take a lot more time than I anticipate since I am not a programmer at all.

skrommel:
 :tellme: I think it should.

Skrommel

Navigation

[0] Message Index

Go to full version