[Lazarus] How to detect that the Alt-key is released?

JuuS JuuS at mykolab.ch
Sun Aug 2 17:43:43 CEST 2015


Sorry I confused you, my specialty.

What I meant was if you use the 'ssAlt in Shift' line, it won't work if
you only press the alt key because in a keyup handler the key is then
up! And so won't pass the if statement. It would work in a keydown
handler though.

if you press and hold alt and then press and release, for example, 'a'
you will see it catch the state of the alt key.

as to the vk_menu, no idea. But to detect states of shift, control, alt,
etc. the methods I showed are what is normally used.



On 08/02/2015 02:42 PM, Jürgen Hestermann wrote:
> Am 2015-08-02 um 14:33 schrieb JuuS:
>> (btw. this WON'T work in onkeyup with just the alt key...when you lift
>> alt (ie, keyup) it is no longer down and so is not in "Shift", to see it
>> work do something like alt-a).
> 
> But that's just what I want:
> Detect the release of the Alt+key (independend from other keys state).
> 
> So it's not possible?
> 
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




More information about the Lazarus mailing list