 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
JCHT Guest
|
Posted: Sun Dec 02, 2007 3:22 am Post subject: Something could "toggle between sets of hotkey remappin |
|
|
I'm trying to write a scrip that can toggle between sets of hotkey remappings.
Which works something like Numlock which can change whole sets of key into another by change the state.
Although the existing "Suspension" commend can sets whole scrip suspend, and the existing #IfWinActive can trigger a set of hotkey remapping for certain software.
But I think we need something in between that could make only "partial suspension" or "partial activation", or something even better which can "toggle freely between sets of hotkey remappings".
thanks AutoHotKey |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Mon Dec 03, 2007 7:38 pm Post subject: |
|
|
I think something like this has been done manually using #IfWinActive and small hidden GUI windows. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
JCHT Guest
|
Posted: Thu Dec 06, 2007 8:44 am Post subject: |
|
|
Thanks for your reply
| engunneer wrote: | | I think something like this has been done manually using #IfWinActive and small hidden GUI windows. |
I'm wandering if you could post us an example, I would be very appreciate that.
For instance, like the notebook's keyboard useing F6 as NumLock and activate n,j,k,l,u,i,o,7,8,9 as 0,1,2,3,4,5,6,7,8,9 and /, ; ,p,0 as +,-,*,/.
And those can activate in any window any time when needed.
Thanks |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2739 Location: Australia, Qld
|
Posted: Thu Dec 06, 2007 10:48 am Post subject: |
|
|
| Code: | Gui, 77: +LastFound +ToolWindow
; Use ID rather than name for efficiency. (Relies on DetectHiddenWindows=Off.)
GroupAdd, NumLock, % "ahk_id " WinExist()
return
F6::
ifWinExist, ahk_group NumLock
Gui, 77: Cancel
else
Gui, 77: Show, NA
return
#IfWinExist ahk_group NumLock
j::1
k::2
l::3
u::4
i::5
o::6
/::NumpadAdd
`;::NumpadSub
p::NumpadMult
0::NumPadDiv |
Uses #IfWinExist and a zero-size "visible" or hidden GUI window, rather than #IfWinActive and small hidden GUI windows.  |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Thu Dec 06, 2007 5:11 pm Post subject: |
|
|
| lexikos wrote: |
Uses #IfWinExist and a zero-size "visible" or hidden GUI window, rather than #IfWinActive and small hidden GUI windows.  |
D'oh. Of course I meant #IfWinExist.  _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
JCHT Guest
|
Posted: Fri Dec 07, 2007 3:55 pm Post subject: |
|
|
thanks lexikos,
the code works well
for other viewers, you can add #IfWinExist in the end of that code to end that set of remapping.
And is this kind of remapping can be toggle by GetKeyState, too?  |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2739 Location: Australia, Qld
|
Posted: Fri Dec 07, 2007 11:43 pm Post subject: |
|
|
| It can be toggled whenever you want... Why GetKeyState? |
|
| Back to top |
|
 |
JCHT Guest
|
Posted: Thu Dec 13, 2007 1:26 pm Post subject: |
|
|
| lexikos wrote: | | It can be toggled whenever you want... Why GetKeyState? |
yes, cause i'm using the KVM software at the same time, and the other computer couldn't receive the remapping which need to toggled up by the server computer side.
but i found out that when i press {NumLock} key both side will responce and then i'm wandering if this could be a way so solve that small problem.
And now i'm trying to just write another code just the Num remapping part for the other computer to see if that will work out, hope the program for both side won't mass up.  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|