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 

AltGr detection

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Fri Oct 01, 2004 2:34 pm    Post subject: AltGr detection Reply with quote

Hülyesamu asked here if it is possible to distinguish between AltGr and Ctrl+Alt. If so, it would allow AltGr hotkeys to be independent of Ctrl+Alt, which might provide a greater quantity of easier-to-reach hotkeys for some users.

At first I thought I'd have to change the program to detect AltGr, but it now seems this is not necessary, at least for hotkeys. To make an AltGr hotkey, the following seems to work on Windows NT/2000/XP:

<^>!m::MsgBox You pressed AltGr+m.
^!m::MsgBox You pressed Ctrl+Alt+m

The above relies on the fact that AltGr causes left-control (<^) and right-alt (>!) to be physically pressed down together.

If anyone else has an interest in this, perhaps you could try out the two lines above and share your findings here. If it works on most layouts and keyboards, I'll update the documentation to mention it.
Back to top
View user's profile Send private message Send e-mail
BoBo
Guest





PostPosted: Fri Oct 01, 2004 4:16 pm    Post subject: Reply with quote

The above code/hotkey(s) have worked fine with a German keyboard (layout)

Cool
Back to top
Hülyesamu



Joined: 24 Sep 2004
Posts: 17

PostPosted: Fri Oct 01, 2004 10:30 pm    Post subject: Reply with quote

I foud it a great idea, and I managed to simplify it by one character Smile

since the AltGr is the right Alt, and it acts as an Ctrl+Alt, to make the AltGr signal You can press both the right or the Left Ctrl:

Code:
^>!m::MsgBox You pressed AltGr+m.
^!m::MsgBox You pressed Ctrl+Alt+m


And I have foud something interesting feature of the Autohotkeys: I use A4tech mice and keyboards, and there was a stupid problems with theese -otherwise excellent- peripherals: On more models, under both 2000 and XP, sometimes the Numpad+ stopped to work and after a while accidentally it started to work normally. Now I became to able to uninstall the keyboard driver, and I plan to uninstall the mouse driver too, and Autohotkey wiil act as the driver for them. Untill now, Autohotkey replaced 3 programs (being the 3rd the apostrophed 'Hotkeys').
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Fri Oct 01, 2004 10:47 pm    Post subject: Reply with quote

Quote:
Autohotkey wiil act as the driver for them
That's nice. I was able to do something similar: I have a favorite mouse that sends bad "bounce" clicks sometimes. By checking the timing between clicks, I was able to filter out the bad clicks and "fix" the mouse.
Back to top
View user's profile Send private message Send e-mail
Hülyesamu



Joined: 24 Sep 2004
Posts: 17

PostPosted: Fri Oct 01, 2004 11:24 pm    Post subject: Reply with quote

I am plannig some more interesting thing: I've decided to buy a mouse with 8 buttons, and use 3 button the normal way, while the other 5 will be used for reaching menus, based on Rajat' excellent ToolTip Mouse Menu, although simplified extensively. My script has only 30 lines.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Sat Oct 02, 2004 1:23 pm    Post subject: Reply with quote

Since I believe the OS only supports 5 mouse buttons, you may have to rely on the software that came with your mouse to assign actions to the other 3 buttons. For example, you might be able to configure those buttons to send keystrokes, and those keystrokes could be detected by a script as hotkey presses.
Back to top
View user's profile Send private message Send e-mail
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