Skip to content
  • Gerd Hoffmann's avatar
    47ddfab1
    kbd-state: add keyboard state tracker · 47ddfab1
    Gerd Hoffmann authored
    
    
    Now that most user interfaces are using QKeyCodes it is easier to have
    common keyboard code useable by all user interfaces.
    
    This patch adds helper code to track the state of all keyboard keys,
    using a bitmap indexed by QKeyCode.  Modifier state is tracked too,
    as separate bitmap.  That makes checking modifier state easier.
    Likewise we can easily apply special handling for capslock & numlock
    (toggles on keypress) and ctrl + shift (we have two keys for that).
    
    Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
    Message-id: 20190122092814.14919-2-kraxel@redhat.com
    
    [ kraxel: added license boilerplate header ]
    
    Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    47ddfab1
    kbd-state: add keyboard state tracker
    Gerd Hoffmann authored
    
    
    Now that most user interfaces are using QKeyCodes it is easier to have
    common keyboard code useable by all user interfaces.
    
    This patch adds helper code to track the state of all keyboard keys,
    using a bitmap indexed by QKeyCode.  Modifier state is tracked too,
    as separate bitmap.  That makes checking modifier state easier.
    Likewise we can easily apply special handling for capslock & numlock
    (toggles on keypress) and ctrl + shift (we have two keys for that).
    
    Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
    Message-id: 20190122092814.14919-2-kraxel@redhat.com
    
    [ kraxel: added license boilerplate header ]
    
    Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
Loading