AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Something could "toggle between sets of hotkey remappin

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
JCHT
Guest





PostPosted: Sun Dec 02, 2007 3:22 am    Post subject: Something could "toggle between sets of hotkey remappin Reply with quote

I'm trying to write a scrip that can toggle between sets of hotkey remappings. Rolling Eyes
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.

Idea 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

PostPosted: Mon Dec 03, 2007 7:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
JCHT
Guest





PostPosted: Thu Dec 06, 2007 8:44 am    Post subject: Reply with quote

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.
Rolling Eyes 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

PostPosted: Thu Dec 06, 2007 10:48 am    Post subject: Reply with quote

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. Wink
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Thu Dec 06, 2007 5:11 pm    Post subject: Reply with quote

lexikos wrote:

Uses #IfWinExist and a zero-size "visible" or hidden GUI window, rather than #IfWinActive and small hidden GUI windows. Wink


D'oh. Of course I meant #IfWinExist. Embarassed
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
JCHT
Guest





PostPosted: Fri Dec 07, 2007 3:55 pm    Post subject: Reply with quote

thanks lexikos,
the code works well Laughing

for other viewers, you can add #IfWinExist in the end of that code to end that set of remapping.

Idea And is this kind of remapping can be toggle by GetKeyState, too? Rolling Eyes
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 2739
Location: Australia, Qld

PostPosted: Fri Dec 07, 2007 11:43 pm    Post subject: Reply with quote

It can be toggled whenever you want... Why GetKeyState?
Back to top
View user's profile Send private message
JCHT
Guest





PostPosted: Thu Dec 13, 2007 1:26 pm    Post subject: Reply with quote

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. Wink
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group