[Gambas-user] Keyboard input help requested

Cogier charlie at ...2793...
Thu Mar 22 10:30:38 CET 2012


Benoît,

I am using Gambas 2.21 and tried the code below but I still get nothing when
pressing the keyboard, in fact the SUB does not seem to be called at all.

What am I missing?

Thanks,

Charlie Ogier

' Gambas class file

PUBLIC SUB Form_Open()
FMain.Show
END

PUBLIC SUB Application_KeyPress()
 
   PRINT "Key";; Key.Code;; "'"; Key.Text; "' has been pressed."
   PRINT "Was here"
 
END

Benoît Minisini wrote:
> 
> Le 17/03/2012 13:18, Cogier a écrit :
>>
>> Benoît,
>>
>> Thanks for the reply. I don't seem to understand how to use your advice.
>> Can
>> you please provide a working example.
>>
>> Thanks for any assistance.
>>
>> Charlie Ogier
>> Les îles Anglo-Normandes
>>
> 
> Let's suppose that your startup class is a module named "MMain".
> 
> ' MMain.module
> 
> Public Sub Main()
> 
>    MyForm.Show
>    ...
> 
> End
> 
> Public Sub Application_KeyPress()
> 
>    Debug "Key";; Key.Code;; "'";Key.Text;"' has been pressed."
> 
> End
> 
> 
> -- 
> Benoît Minisini
> 
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here 
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> 
-- 
View this message in context: http://old.nabble.com/Keyboard-input-help-requested-tp33496560p33544605.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list