I need to perform an action on pressing the CapsLock Key.
If I press it, the keyboard NSKeyDown event came. The LED on this key light up.
I have a boolean buffer for the whole keyboard. It stores if a key is pressed or not.
He trows me that CapsLock is pressed the whole time(no KeyUp event).
So I need to set the CapsLock off. So he can perform the NSKeyUp.
case myType of
NSKeyDown : if event.keycode < 256 then keyboard[event.keycode]:=true;
NSKeyUp : if event.keycode < 256 then keyboard[event.keycode]:=false;
NSFlagsChanged : if event.keycode < 256 then keyboard[event.keycode]:=not keyboard[event.keycode];
NSLeftMouseDown: mouseL:=true;
NSRightMouseDown: mouseR:=true;
NSLeftMouseUp: mouseL:=false;
NSRightMouseUp: mouseR:=false;
NSScrollWheel : mouseWheel:=round(event.deltaY);
end;
Or you knew a better solution?
AND (as we are at this topic)
If I press CapsLock very shortly nothing happens. We waits a little time before raise the event(the LED goes on).
How to get rid of this delay?