Jump to content
Sign in to follow this  
Levisaxos

Send key from hex value

Recommended Posts

Levisaxos

Simple question:

Is it possible to send a key stroke by hexadecimal value?

Asin,  is there a function that sends a F11 when you input 7A as hexadecimal value?

Share this post


Link to post
Share on other sites
AutID

Hex for the 7A returns a "z" letter on send command in an ASC return. Hex of the F11 must be around 133 if I remember well. Search the internet. As far as I know the return set of autoit are not correct for all letters.

P.S Why don't you just Send("{F11}"). In case you return it in Hex and you to send it directly then you can use _HetToString function and then send it. You can find it in the String.au3 udf
 

Share this post


Link to post
Share on other sites
James

Hex for the 7A returns a "z" letter on send command in an ASC return. Hex of the F11 must be around 133 if I remember well. Search the internet. As far as I know the return set of autoit are not correct for all letters.

P.S Why don't you just Send("{F11}"). In case you return it in Hex and you to send it directly then you can use _HetToString function and then send it. You can find it in the String.au3 udf

 

From the OP's first post, he wants to send a key when something is typed, so every time he types "7" and then "A" he want to send F11. That's different to what you're suggesting.

Share this post


Link to post
Share on other sites
AutID

From the OP's first post, he wants to send a key when something is typed, so every time he types "7" and then "A" he want to send F11. That's different to what you're suggesting.

Are you sure? Because hex 7A is the hex of F11 which autoit gives... But read the tittle. He is asking if it is possible to send a key from its hex value...

In any case, if you are right then this should work.

#include <Misc.au3>
HotKeySet("t", "_exit")
Local $hDLL = DllOpen("user32.dll")
While (True)
 If _IsPressed("37", $hDLL) Then
  If _IsPressed("41", $hDLL) Then
   Send("F11")
  EndIf
 EndIf
WEnd
Func _exit()
 Exit
EndFunc

 

It only works if the two keystrokes 7 + A are pressed the same time or close enough...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×