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 

How to remap a key such as Ctrl but still have it fire hkeys

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
sickpuma



Joined: 28 May 2009
Posts: 8

PostPosted: Tue Nov 17, 2009 11:57 am    Post subject: How to remap a key such as Ctrl but still have it fire hkeys Reply with quote

Let's say I have a script which binds Ctrl+F to some method. But I also want to remap my AppsKey to Ctrl. How do I remap the AppsKey and still let it fire my own method when I press ApssKey+F. (Note: I don't want to redefine the hokey since there are lot's of hotkeys that should work with both keys).

I tried to do the following:

Code:
^f::SomeFunction()
AppsKey::Ctrl


When I press Ctrl+F, it triggers the function correctly, but when I press AppsKey+F, it doesn't trigger the function.

What's the best way to do this?
Thanks
Back to top
View user's profile Send private message
aaffe



Joined: 17 May 2007
Posts: 941
Location: Germany - Deutschland

PostPosted: Tue Nov 17, 2009 12:34 pm    Post subject: Reply with quote

Code:
^AppsKey::SomeFunction()
AppsKey::Ctrl

??
Back to top
View user's profile Send private message
sickpuma



Joined: 28 May 2009
Posts: 8

PostPosted: Tue Nov 17, 2009 12:56 pm    Post subject: Reply with quote

Nope that doesn't work. I don't want to define the hotkey with AppsKey if possible so that it works with both Ctrl and AppsKey and I don't have to duplicate multiple hotkeys.

Also, the hotkeys you provided doesn't make AppsKey+F or even Ctrl+F work so it doesn't help.

Thanks for trying though
Back to top
View user's profile Send private message
Peter



Joined: 30 Dec 2005
Posts: 448

PostPosted: Tue Nov 17, 2009 1:08 pm    Post subject: Reply with quote

sickpuma wrote:
When I press Ctrl+F, it triggers the function correctly, but when I press AppsKey+F, it doesn't trigger the function.
I don't have that problem. But if you have many other hotkeys, then there's maybe another hotkey that overtakes when defined after this?
Code:
^f::msgbox %A_ThisHotkey% function  ; called with Ctrl-F and Ctrl-AppsKey
AppsKey::Ctrl
Back to top
View user's profile Send private message
sickpuma



Joined: 28 May 2009
Posts: 8

PostPosted: Tue Nov 17, 2009 11:01 pm    Post subject: Reply with quote

Yeah, you're right. I just tried it with a new script and it works both with #usehook on and off.

btw, I think you meant Ctrl+F and AppsKey+F, not Ctrl+F and AppsKey+Ctrl.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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