Menu

Keyboard event

Help
2007-08-14
2013-04-23
  • Bruno Sampayo

    Bruno Sampayo - 2007-08-14

       When gizmod get an event from the keyboard (ex: key: "Y"). Can incapacitate the sending of this keyboard key for the application?
       Other ex: I would like to send for the application only the keyboard keys that I capacitate. (enable only numeric's keys for the application).

    Thanks for any help,
    Bruno Sampayo

     
    • Tim Burrell

      Tim Burrell - 2007-08-14

      Hey Bruno,

      Yes this can be done!  Unfortunately, however, if you want to prevent events from going through to other applications you need to grab exclusive access to the device, which means no events will get through, so you'll have to translate them all!

      It also has to be done system wide, so in order to achieve this on a per application basis you'll need to use the window focus events that gizmod detects.  For example, if the desired application is focused, set exclusive access, and if it's not focused, disable exclusive access.

      The function you want is "grabExclusiveAccess", as seen here: http://gizmod.sourceforge.net/documentation/apidocs/a00258.html#96b932a83d3c98ce617a0604230423f3

      Also see the WindowFocus events: http://gizmod.sourceforge.net/documentation/apidocs/a00257.html

      Does this help at all?

      Thanks,

      Tim.

       
    • Bruno Sampayo

      Bruno Sampayo - 2007-08-15

      thanks Tim.
      But how and where (in which scripts of gizmod) I must call the method grabExclusiveAccess()?
        For example we try to include called of this method in this script 150-Keyboard-Amarok.py
        that it comes as example in GizmoDaemon installation package version v3.3 (gizmod)
      - = - (c) 2007, Tim Burrell <tim.burrell@gmail.com>

        With the following error:
          TypeError: unbound method Boost.Python.function object must be called with
          GizmoLinuxInputDevice instance first argument (got bool instance instead)

        Do you have some example how to use grabExclusiveAccess method?

      Thanks for help,
      Bruno Sampayo

       

Log in to post a comment.