AutoHotkey Community

It is currently May 27th, 2012, 4:12 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: December 10th, 2010, 1:10 pm 
Offline

Joined: August 28th, 2009, 3:00 pm
Posts: 275
When Colemak v1.1 is the default keyboard layout on Windows 7 (and possibly XP or Vista, but untested), using ` and ~ as endkeys for the Input function map to R and G respectively; so R and G terminate the input.

This *only* happens when they are mapped as EndKeys. The actual input character is detected correctly.

This does not happen when using Colemak v1.0 on XP (1.0 does not work on Windows 7 or Vista).

Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 17th, 2011, 2:51 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
AutoHotkey uses VkKeyScanEx to map the end chars to virtual key codes or scan codes when it begins collecting input, for performance. (The keyboard hook can be considered performance-critical.) There are a few problems with this method:
  1. It uses the script's keyboard layout to perform the mapping. Most scripts would be using the system default layout, which may be different to the active window's layout. Even if it used the active window's layout, the user could switch to some other window, or even change the keyboard layout in use by the active window.
  2. It isn't designed to handle Ctrl or Alt modifiers, only Shift.
  3. There may be multiple keys/key-combinations which can produce any given end char. Only the key or key-combination returned by VkKeyScanEx has any chance of working.
When I tested, VkKeyScanEx returned Ctrl+Alt+R for ` and Ctrl+Alt+Shift+R for ~. I've confirmed that these key combinations do indeed produce ` and ~, so VkKeyScanEx is producing correct results (though not the results we want). Side note: AltGr and Ctrl+Alt are equivalent.

In this case, using {vkC0} in place of ``~ might provide a partial workaround.

There doesn't seem to be any simple way to fix this, but I've made a note to look into it again at a later date.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 18th, 2011, 11:43 am 
Offline

Joined: August 28th, 2009, 3:00 pm
Posts: 275
OK, thanks Lexikos! For the time being I have worked around the problem a different way, though I may try your suggestion with vkC0.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 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