topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 3:53 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Extra mouse buttons combo  (Read 6351 times)

kartal

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 1,529
    • View Profile
    • Donate to Member
Extra mouse buttons combo
« on: December 04, 2008, 12:01 AM »
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

  • Supporting Member
  • Joined in 2008
  • **
  • default avatar
  • Posts: 38
    • View Profile
    • Donate to Member
Re: Extra mouse buttons combo
« Reply #1 on: December 07, 2008, 01:53 PM »
I think you canĀ“t press 2 buttons at the same Time.
--
Greets, computerfritze

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: Extra mouse buttons combo
« Reply #2 on: December 07, 2008, 04:56 PM »
 :) 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

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 1,529
    • View Profile
    • Donate to Member
Re: Extra mouse buttons combo
« Reply #3 on: December 07, 2008, 05:11 PM »
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

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: Extra mouse buttons combo
« Reply #4 on: December 09, 2008, 03:40 AM »
 :tellme: I think it should.

Skrommel