TTrayIcon and TShiftstate lazarus / 31-LCL ---------------------------------------------------------------------- olafr82110 · 2012-10-26 09:06 Hi, I have a problem with TTrayicon on windows. I want to implement a trayicon which displays two different popup menus, depending on the shiftstate. So i just created an onmousedown procedure, checked if the right mouse button is pressed an then wanted to check the shiftstate. But no matter what I'm pressing shift always returns [SSCTRL..SSLEFT, SSMIDDLE]. Am I just to dumb to see the pink elephant, or is there a known problem with TTrayicon and Tshiftstate? Btw: Just to check if my code is working, I assigned it to an edit component, and everything was fine... Any suggestions? Olaf ---------------------------------------------------------------------- KpjComp · 2012-10-26 11:05 If you include LCLIntf and LCLType in your uses clause, you can access the keyboard directly like -> Code: [Select]procedure TForm1.TrayIcon1MouseUp(Sender: TObject; Button: TMouseButton;   Shift: TShiftState; X, Y: Integer); begin   if (GetKeyState(VK_SHIFT) and $8000)<>0 then     showmessage('shift')   else     showmessage('no shift'); end; No sure how cross-platform this is though, but it is using the LCL unit so in theory should be good to go. ---------------------------------------------------------------------- Mando · 2012-10-26 11:28 Use  VK_LBUTTON, VK_RBUTTON, VK_MBUTTON to check left., right, and middle button respectively. regards. ---------------------------------------------------------------------- olafr82110 · 2012-10-26 11:29 Thanks for the tips. That's working. And as far as crossplatform is concerned... I don't really need it for this project. Thanks.