[Gambas-user] Highlight Editor - Capslock Key State

MaxVK maximvonk at ...626...
Wed Feb 13 21:21:19 CET 2008


Aha! Scrap the first message! It DOES work, but...

The Form_KeyPress event would not seem to fire at all, so I added an
invisible button to the form, and as the last line in the Form_Open event I
added Button1.SetFocus. With the code from the Form_Activate event in your
example in the Button1_GotFocus event the Keypress was now firing and the
State of the capslock key was successfully read.

Thanks again Stefano, I'm not sure why I had to change the code like that
(Your example works on its own), but its working now.

All the best

Max



Stefano Palmeri wrote:
> 
> Alle 12:53, mercoledì 13 febbraio 2008, MaxVK ha scritto:
>> Hi there, I'm using the Highlight editor in Gambas2 and have added a
>> status
>> bar at the bottom of the editor window. I would like to be able to
>> display
>> the state of the capslock key there, but the problem I have is that while
>> I
>> can detect when capslock has been pressed, I cant seem to determine its
>> state before the keypress.
>>
>> In other words I cant tell the state of the capslock key when the program
>> is started, so I cant accurately display its state within the program
>> because I have to make an assumption about its state in the first place.
>>
>> Can anyone point me in the right direction please?
>>
>> Thanks
>>
>> Max
> 
> Hi,
> 
> the attached example shows a raw dirty way to know
> if the capslock key is on/off on startup.
> Use at your own risk :-)
> 
> Bye,
> 
> Stefano 
> 
> 
> 
>  
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> 

-- 
View this message in context: http://www.nabble.com/Highlight-Editor---Capslock-Key-State-tp15456466p15466932.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list