[Gambas-user] Sending key code (macro recorder)

Gianluigi bagonergi at gmail.com
Tue Nov 3 19:32:46 CET 2020


Il giorno mar 3 nov 2020 alle ore 19:10 Bruce Steers <bsteers4 at gmail.com>
ha scritto:

> Hi all.
> I'm trying to make a macro recorder to record keyboard events and play
> them back.
>
> Got a problem though.
>
> the recorder can record the Key.Code fine (for things like up and down
> arrow that do not have Key.Text)
> But i cannot send it back that way.
>
> According to the wiki SendKeys page it says  this..
> *What is sent is not a string, but the internal key codes associated with
> them. *
> Yet i try to send a Key.Code and it complains i sent an integer not a
> string.
>
> Am i going to have to map out a complete list of strings to match all
> codes that Don't have Key.Text ?
>
> Or can someone suggest a better way to record key events them play them
> back?
>
> And yes i read the warning about not using Key.Code as they differ between
> gtk and qt but for a macro recorder i do not see it matters unless i want
> to save the macros and use them on a different system.
>

Not sure I understand, look for this:
Print String.Chr(Key.Code) ' ?

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201103/4b386b45/attachment.htm>


More information about the User mailing list