Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Key press detected but script doesn't execute



  • Please log in to reply
4 replies to this topic
Fruitbat
  • Members
  • 2 posts
  • Last active: Mar 29 2015 11:43 PM
  • Joined: 29 Mar 2015

Hello,

 

I'm trying to bind my tablet's screen-rotate button to a batch file I've made to enable/disable the touchscreen.

 

When I view KeyHistory after pressing it, I get:

 

VK  SC Type Up/Dn Elapsed Key Window
-------------------------------------------------------------------------------------------------------------
5B  15B d 2.53 LWin          
7D  065 d 0.00 F14            
5B  15B u 0.22 LWin          
7D  065 u 0.00 F14                     
 
So it seems that each keypress generates *two* input events, SC15B and SC065.
 
If I try to execute code when SC15B is pressed, it works fine, however the script then also executes when I press my Windows key. So I'd like to use SC065 instead, but when I do this the code does not execute, even though the event is recorded in KeyHistory.
 
The code I'm using is just a very basic test case:
 
SC065::
MsgBox, Rotate button pressed
Return
 
Can anybody explain why this does not work? Thanks.
 


Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

Notice that when SC065 is down (It looks like you could use F14 as the name instead), that LWin - a modifier key - is also down. Your hotkey should instead be this:

 

#SC065:: or #F14. If that doesn't seem to work, let's use the * wildcard modifier: *SC065:: or *F14::.



T_Lube
  • Members
  • 640 posts
  • Last active: Sep 09 2016 02:19 AM
  • Joined: 16 Oct 2014
✓  Best Answer

try letting the key stroke to pass through to the computer instead of getting captured.

~#F14::
Msgbox, Rotate pressed.
Return


Fruitbat
  • Members
  • 2 posts
  • Last active: Mar 29 2015 11:43 PM
  • Joined: 29 Mar 2015

 

try letting the key stroke to pass through to the computer instead of getting captured.

~#F14::
Msgbox, Rotate pressed.
Return

 

This worked! Thank you so much!

 

Now to figure out how to disable the rotate function when that key is pressed...



T_Lube
  • Members
  • 640 posts
  • Last active: Sep 09 2016 02:19 AM
  • Joined: 16 Oct 2014

Oh if that is what you are trying to do then remove the tilde "~". I thought you wanted it to rotate as well as run your script. What happens if you just use the #F14:: hotkey?