SendKey codes

Post your Gambas programming questions here.
Post Reply
User avatar
BruceSteers
Posts: 1563
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

SendKey codes

Post by BruceSteers »

Hi folks.

Anyone know if it's possible to use Desktop.SendKey to send the key "Code"

Specifically the code not text

Ie.
Pressing down arrow Gives the Key.Code as 65364
I can't seem to send it back that way.
I could send a Key["DOWN"] but i'm trying to make a macro recorder and pressing keys gives a numeric code 65364 not a string like "DOWN"

According to wiki SendKeys sends the code and not the string and you need to use something like Key["DOWN"] to send the down code but if i try SendKeys tells me it wanted a string but got an integer.

Tia :)
Bruce
If at first you don't succeed , try doing something differently.
BruceS
User avatar
cogier
Site Admin
Posts: 1125
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: SendKey codes

Post by cogier »

I can't find the warning I was looking for, but I am sure it goes something like 'Don't use codes as GTK and QT use different code for the same key'.
User avatar
BruceSteers
Posts: 1563
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: SendKey codes

Post by BruceSteers »

cogier wrote: Tuesday 3rd November 2020 5:37pm I can't find the warning I was looking for, but I am sure it goes something like 'Don't use codes as GTK and QT use different code for the same key'.
Yes but for a macro recorder it shouldn't matter.

Code recorded at the time should match code sent back regardless of system differences right?
If at first you don't succeed , try doing something differently.
BruceS
Post Reply