[Gambas-user] Keyboard input help requested

François Gallo basic.gambas at ...626...
Thu Mar 22 11:08:40 CET 2012


Le 22/03/2012 10:30, Cogier a écrit :
> 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

Hello Charlie,

i think your mistake comes from the name of event manager.
You want to call the _KeyPress() event but from which control?

Furthermore, you're calling FMain.Show but once again, are there
two windows into your project? if you have one window (the main form)
you don't have to call it.

For me the name : "Application_"  is a static class that gives you 
information
about your program. And this one has only one special event named 
"_Read()" .

-- 
François Gallo





More information about the User mailing list