Menu

How to discard input device events?

Help
2007-10-22
2013-04-23
  • Bruno Sampayo

    Bruno Sampayo - 2007-10-22

    We're using GIZMOD 3.3 in Debian (Etch) version with dual independent display controlling mouse, keyboard and a remote control with XOrg (XWindows System) 7.1.1.

    What is the best way to temporarily discard any events from input devices using GizmoD and back on again?

    In other words, I wanna grab total control from all user input devices while the system is performing some activities like updating or installing packages.

    thanks, bruno.

     
    • Tim Burrell

      Tim Burrell - 2007-10-22

      Hey Bruno,

      There is a function grabExclusiveAccess() that can be use for this purpose: http://gizmod.sourceforge.net/documentation/apidocs/a00258.html#96b932a83d3c98ce617a0604230423f3

      This will only work for input devices that are classed as regular input devices... ie keyboards, mice, joysticks, other usb devices, etc.  Remote controls (depending on the type) may need a different technique.

      It just occurred to me that currently there's no easy way to loop through all the enumerated devices one by one to apply the function.  (Added to the TODO list).

      For now what you could do is check GizmoRegistrar.d.

      In handleDeviceAddition() add a line at the top that adds each device to a python list or dictionary, and in handleDeviceRemoval remove the device from the list.

      Then whenever you want to disable the devices loop through them all and call grabExclusiveAccess(true), similar for re-enabling them.

      Does this make any kind of sense?

      Thanks,

      Tim.

       

Log in to post a comment.