AutoHotkey Community

It is currently May 27th, 2012, 12:44 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: September 29th, 2005, 5:24 pm 
When I look at the key history, after pressing AltGr, it looks like this (which is fine):

Code:
A2  01D       d   2.69   Ctrl
A5  138       d   0.00   Right Alt
A2  01D       u   0.08   Ctrl
A5  138       u   0.00   Right Alt


However, if I then enable a hotkey that looks like this:

Code:
LControl & RAlt::return


...I get a key history that looks like this:

Code:
A2  01D       d   1.95   Ctrl
A5  138   h   d   0.00   Right Alt
A2  01D       u   0.00   Ctrl
A5  138   i   u   0.00   Right Alt
A2  01D       u   0.06   Ctrl
A5  138   s   u   0.00   Right Alt


It shows the keyboard sending Ctrl-up twice, which doesn't match the previous log. I presume that the inserted/suppressed Ctrl Alt sequence is just missing the 'i' or 's' for the first line of each, which might only be minor, but it's impeding my progress in diagnosing an issue with a larger script.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 30th, 2005, 4:34 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Quote:
A5 138 i u 0.00 Right Alt
This extra keystroke is intentional for pure Alt hotkeys. It serves to "turn off" the OS's low-level handling for the alt key with respect to having it modify future keystrokes. For example, the following hotkeys would fail to work properly without this behavior because the OS apparently sees that the ALT key is physically down even though it is not logically down:

RAlt::Send f ; Would actually send !f, which activates the FILE menu if the active window has one.
RAlt::Send {PgDn} ; Would fail to work because it would actually send ALT-PgDn.

By the way, you may know that releasing AltGr instantly causes the release of LControl too (it's a built-in feature of AltGr). This explains the presence of each Ctrl-up event in the key history.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 30th, 2005, 2:44 pm 
I meant that the trace that looked like this:

Code:
A2  01D       d   1.95   Ctrl
A5  138   h   d   0.00   Right Alt
A2  01D       u   0.00   Ctrl
A5  138   i   u   0.00   Right Alt
A2  01D       u   0.06   Ctrl
A5  138   s   u   0.00   Right Alt


Should have looked like this:

Code:
A2  01D       d   1.95   Ctrl
A5  138   h   d   0.00   Right Alt
A2  01D   i   u   0.00   Ctrl
A5  138   i   u   0.00   Right Alt
A2  01D   s   u   0.06   Ctrl
A5  138   s   u   0.00   Right Alt


Essentially, the first trace in my first post showed that the sequence of events from the keyboard only had one ctrl-up, which is correct. The last trace in my first post (same as the first in this post) shows two ctrl-ups coming from the keyboard, which is incorrect. I think the 'i' and 's' are missing for the 'Ctrl' lines.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 1st, 2005, 3:09 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Thanks for clarifying. The 'i' is missing from the Ctrl-up events because they're always generated by the keyboard driver and thus seen as physical events. By contrast, events sent directly by the script get an 'i'.

You could argue that the driver events should get an 'i' because they're indirectly generated by the script. However, this seems too obscure to justify the added code size.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group