[Lazarus] TShiftState "lock" states in mousewheel events

Hans-Peter Diettrich DrDiettrich1 at aol.com
Tue Oct 4 01:44:33 CEST 2011


Alexander Klenin schrieb:

>> AFAICS the key state will report whether the "lock key"
>> is pressed down, not it's toggled state.
> 
> No, at least in my tests on Win32 they did indicate toggled state.
> Otherwise | would not have a problem in the first place.

AFAIR GetAsyncKeyState encodes both the key state (up/down) and the lock 
state (locked/unlocked) in different bits of the byte array. But this 
may be different on other platforms, possibly unavailable information 
(private to the keyboard driver...). On mobile devices without a (full) 
keyboard the shift and lock states may be emulated, not corresponding to 
physically absent keys.

Therefore the TShiftState, as used with mouse messages, should include 
only commonly available keys and buttons, as far as *usable* to modify 
*mouse* operations. A software, checking for e.g. a combination of 
CTRL-left and SHIFT-right while the mouse wheel is turned, would not be 
very "handy" to use ;-)

DoDi





More information about the Lazarus mailing list