[Gambas-user] Keyboard input help requested

Benoît Minisini gambas at ...1...
Thu Mar 15 22:52:04 CET 2012


Le 15/03/2012 14:21, Cogier a écrit :
>
> Rolf,
>
> Thanks for the reply. Yes it does work in Linux and I can get it to work in
> a TextBox but as you say it needs to be in focus and I think the program
> will look silly if at the time of a scan the particular TextBox is not in
> focus. I know there is a way to capture a single key press but I want to
> capture the whole string. The input string is terminated by a "Return" code
> so I can handle the end of the string with code.
>
> So I am looking for a way to capture the input string directly from the
> "Keyboard" with code rather than a TextBox.
>
> Thanks,
>
> Charlie
>
>

Define an public Application_Keypress() event handler in the startup 
class. It will catch all key events received by the application (but not 
the key events received by other applications of course).

Regards,

-- 
Benoît Minisini




More information about the User mailing list