Find the answer to your Linux question:
Results 1 to 2 of 2
I used to do in windows: SHORT key1 = ::GetKeyState(VK_LSHIFT)& 0xF0; SHORT key2 = ::GetKeyState(VK_RSHIFT)& 0xF0; SHORT key3 = ::GetKeyState(VK_LCONTROL)& 0xF0; SHORT key4 = ::GetKeyState(VK_RCONTROL)& 0xF0; bShift = (key1 != ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2012
    Posts
    1

    How to identify shift/ctrl keys were pressed in the linux world ?


    I used to do in windows:

    SHORT key1 = ::GetKeyState(VK_LSHIFT)& 0xF0;

    SHORT key2 = ::GetKeyState(VK_RSHIFT)& 0xF0;

    SHORT key3 = ::GetKeyState(VK_LCONTROL)& 0xF0;

    SHORT key4 = ::GetKeyState(VK_RCONTROL)& 0xF0;


    bShift = (key1 != 0) || (key2 != 0);

    bCtrl = (key3 != 0) || (key4 != 0);

    How to detect if the shift/ctrl keys were pressed in the linux world? Without using GL(it can be pressed not in the graphic window..) or X11.. Is there something general to retrieve it directly form the OS?

    Thanks, Vladimir.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,539
    Is your system running a GUI, or is it text only? The approaches are very different depending.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •