Prevent games from grabbing every key & mouse button

I've been gaming a lot of native linux games (especially the Humble Bundle ones), and a great deal of them tend to grab the all the keyboard and mouse keys/buttons.
This means that NO keys work; for example, I've a mouse with lots of buttons, and some of these control my volume (via xbindkeys). Some media keys on my keyboard do this as well, and control vlc play/stop (also via xbindkeys), and some other switch desktop, minimize, etc (via compiz keybinds).
Is there a way to keep these games for grabbing these keys/mouse-buttons? I kind of lose control of my desktop while they're running. I belive they grab the mouse entirely somehow, though I must admit, I'm not an expert on this area.

I've made two AUR packages for this:
https://aur.archlinux.org/packages.php? … _Search=Go
I'm just using libx11-nokeyboardgrab now, so I let the sdl one go unmaintained.
libx11-nokeyboardgrab is incompatible with dmenu (edit: and password screensavers), but works with everything (also dialog pop-ups).
sdl-nokeyboardgrab doesn't grab non-sdl programs (Virtualbox, maybe Wine, I haven't tested it).
It doesn't prevent mouse grab, because that's necessary for FPS games and Virtualbox mouse mode.
I have thought of adding in a mechanism where the mouse is only grabbed on some condition. Like the existence of a "/tmp/grabmouse" file. But I've been fine without it.
One problem that occurs even with mouse grab enabled is that when the game loses focus, it loses the mouse grab too. When you switch back to the game, you need to do something to make it re-grab the mouse.
For instance in Urban Terror (FPS), when you switch back to the game, the mouse behaves erratic until you press ~ for Console (which normally ungrabs the mouse) and then press it again.
Last edited by Procyon (2012-01-23 20:14:08)

Similar Messages

  • Prevent application from grabbing some keys.

    I have media keys for volume control on my keyboard and use them. I have mapped them with KDE hotkeys control module. All work fine. However, some applications, for example, SDL-based ones, grab all keyboard input, including media keys. I lose ability to change audio volume until I stop the application.
    The question is: How can I protect some keys from being grabbed by applications? I mean, how to make sure that some key events always reach target app, even when another app tries to grab all input. For example, Ctrl-Alt-F1 still works in all apps. Is there X server config to protect another key?
    Last edited by Barafu Albino Cheetah (2011-09-16 20:20:31)

    I've made two AUR packages for this:
    https://aur.archlinux.org/packages.php? … _Search=Go
    I'm just using libx11-nokeyboardgrab now, so I let the sdl one go unmaintained.
    libx11-nokeyboardgrab is incompatible with dmenu (edit: and password screensavers), but works with everything (also dialog pop-ups).
    sdl-nokeyboardgrab doesn't grab non-sdl programs (Virtualbox, maybe Wine, I haven't tested it).
    It doesn't prevent mouse grab, because that's necessary for FPS games and Virtualbox mouse mode.
    I have thought of adding in a mechanism where the mouse is only grabbed on some condition. Like the existence of a "/tmp/grabmouse" file. But I've been fine without it.
    One problem that occurs even with mouse grab enabled is that when the game loses focus, it loses the mouse grab too. When you switch back to the game, you need to do something to make it re-grab the mouse.
    For instance in Urban Terror (FPS), when you switch back to the game, the mouse behaves erratic until you press ~ for Console (which normally ungrabs the mouse) and then press it again.
    Last edited by Procyon (2012-01-23 20:14:08)

  • How do I prevent iPhoto from starting every time I connect to a camera card?

    Every time I put in a camera card iPhoto starts. Is there a way to prevent this short of deleting iPhoto from the applications?

    In the iphoto Preferences disable "connecting Camera opens" - set it to "No application".
    If that does not suffice, do the same in Image Capture:
    In Image Capture - with your camera card inserted- click the disclosure triangle in the lower left corner of the window to reveal the menu to set the preferences for the device:
    Then set the option to "Connectiong this ... opens"  to "No application"

  • Is there a way to prevent timeline from opening every time?

    Every time I create a new project it opens with the timeline open and rulers on.  And it drives me crazy! Anyone else have this issue, or a fix for it?

    That is, apparently, a (&$@# #$*@# $*&$^ #$^@ #$*& @#$*^@!#) BUG that appeared on the last release of Motion. Previously, it remembered your layout preference.
    Try this:
    Start Motion
    Open a Project
    Type F6 (or select Hide Timing Pane from the Window Menu -- IF the timing pane is showing!)
    Quit Motion. (Don't  close the window first... Quit... with the window open!)
    Restart Motion.
    Not guaranteed to work forever. You might occasionally have to redo these steps. (let me know if this worked for you!)

  • How do I prevent iTunes from opening every time I sign on to Windows?

    I have finally gotten iTunes kinstalled on my Windows 7 64 bit computer,, however every time I log in, the iTunes window opens. How do I stop this?

    This is crazy. If they are going to make iTunes available in Windows, must they punish Windows users by making us change config settings just to keep a program from opening at Startup? A simple checkox in the Settings box of iTunes would make it much easier. Why do Apple-based programs that are made available to Windows users not work as Windows programs do?

  • Prevent application from stealing all input

    Some applications grab all keyboard keys in such a way, that my window manager (i3) does not get the keys any more that are meant for it. Until recently, I only came across dosbox and the qemu window with this behavior. But both of them offer a way to stop grabbing every input of the X server (by default, dosbox uses the key binding CTRL+F10, QEMU uses CTRL+ALT). But then I ran OgreSampleBrowser for which I could not find such a key binding (did I miss something). Thus, now I'm interested in a general way to prevent applications to grab every key event if they are part of a key binding of my window manager. Is there some way to only whitelist the ones, which may grab all keys? Additionally to that, OgreSampleBrowser also unconditionally grabbed all mouse input, but I could live with that.
    Any ideas or help, how to circumvent the issue (and still being able to interact with the window manager) is appreciated.

    It is kind of difficult to tell you anything without seeing what you do when the user logs off and just what you mean by turns off. Could you please expand on that: does the app close, do you loose your VPN connect, just what happens?

  • [SOLVED] [Gnome 3] Move/resize with alt+mouse button not working

    Hi,
    Anyone have any ideas why I can't move or resize windows in Gnome 3 with the alt key + mouse button?
    From what I've read it should be possible to do this in Gnome 3, or have they removed it?
    The alt key works fine for other tasks, like alt+f4. By looking at xev the keyboard seems to generate a correct alt key as well:
    KeyPress event, serial 32, synthetic NO, window 0x2200001,
    root 0x15d, subw 0x0, time 74162047, (-380,478), root:(2169,522),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False
    Both the middle and the right mouse button works fine for other stuff, like pasting and opening menus.
    Anyone have any ideas?
    Last edited by mr_echo (2011-09-23 20:18:45)

    I suffer the same problems. metacity is already installed. Any idea what else I might look for?
    And did it reactivate Alt+right-click to resize?
    For geoffm and anyone who stumbles across this, as per http://unix.stackexchange.com/questions … dows-again, you used to be able to use the gconf editor, but now it's (from the command line)
    gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true
    This nearly did my head in back when it changed.. now I just have to find out how to change the behaviour that seems to have cropped up in latest gnome 3.10 update, where you have to click the _left_ mouse button to finish/stop the resize.. Quite annoying

  • I have an Ipod Touch 5th Geneation and Windows Vista.  Unfortunately, everytime I plug in my Ipod, it changes my monitors display (resolution and bit from a 32 down to an 8)  How can I prevent this from happening everytime?  I am unable to read my screen

    I have an Ipod Touch 5th gen and I'm running Windows Vista 32-bit Home Premium.  Unfortunately, everytime I plug in my ipod, my screen resolution changes and i go down to an 8 bit from 32...on its own.  I can I prevent this from happening every time I plug it in to my pc?

    All I can suggest is:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    http://support.apple.com/kb/HT1923Seems it is a windows problem.
    You can also try rolling back the driver for your video card.

  • Stop safari from refreshing every page i go back to

    Is there a way to prevent safari from refreshing every page i go back to in my browsing history?  what is the point of having a cache if safari is going to refresh every page anyway?
    i dont mean dated stuff like 2 weeks ago, i mean every page.
    i swipe and have to wait while safari refreshes, then swipe back again, wait for the refresh and repeat this.  if i quickly swipe back 4 pages, the 4th page back will appear for a second, then the 1st page re-appears cos it is fully refreshed.
    i thought it was just on Facebook that this happened on, but it is on most pages including google searches and this forum.
    very annoying behaviour.

    I am part of a web marketing company and we discovered a very heavy aggravation on top of all the above described annoyances of the refreshing process of safari on iPhone and iPad.
    If the page in refreshing process it was after a direct click on a google "pay per click add", then safari it would re-emulate the click on the google add as well, who will charge the customer for what it looks like a legitimate click !!!!!
    Now my customer put me in charge to collect all the company server's logs and analyse them through one by one ... (millions…),
    once sufficient data will be available we will start a suing process against apple and google.
    Apple, to allow such automatic unconditioned refreshing generating false "pay per click", and Google for charging the customer for illegal clicks. Keep in mind that we receive from 500 to 600 clicks per day at a CPC min £1.90 to max £6.80 depends from competitors biddings, the highest percentage of clicks its about CPC £3.10, making the company spending easily £3,000 per day.
    in the last 7 days we already discovered that about 10% of the clicks are repetitive from iPhone and iPad refreshing their safari cache, making spend the company about £ 2,000 per week in false clicks. we are also trying to discover when was this process generally started,  ie if its been going on for a year, we are talking of some good (£2000 * 52) £100,000 plus our work to investigate.
    I am a big fan of iPhone, and I hope some apple technician will read this message and take action ASAP, because in the next 3-4 weeks, once our investigation its done, all the info and server logs will be publicised on the web … with unfortunate financial consequences …

  • TS4080 apple thunderbolt display image on display intermittently goes dark, does not wake from sleep after clicking mouse or keyboard, but there is "bonk" sound after clicking mouse or pressing keys. Rebooting by pressing the power button resolves issue.

    My apple thunderbolt display (which I purchased 1.5 years ago; OS 10.7.5 Mac Mini) intermittently goes dark, does not wake from sleep after clicking mouse or keyboard, but there is "bonk" sound after clicking mouse or pressing keys, so am thinking it is a hardware problem with the display. Rebooting by pressing the power button turns the screen back on, but the same phenomenon has occurred several times. Could this be a software issue, or do I need to have my display repaired? Your feedback would be appreciated.

    Hi ED, tough to tell, but it does sound like it's waking with the bonk, just not displaying.
    Long shot but...
    I wonder if it's a variation of this, of which I've seen many different symptoms...
    Resolution
    Move the mouse or trackpad cursor over the center area of the login window so you can see the user icons. Click on the icon of the user that you would like to login as, type in the user's password, and press Return.
    If the login window is configured to show only the name and password fields, type in the user's name and password into the fields, and press Return (even if you cannot see the rest of the login window).
    Additional Information
    This issue will not occur if the display is not sleeping when the account is logged out. Use the steps below to confirm that the account is not configured to log out automatically while the display is sleeping:
        1.    Open System Preferences > Security & Privacy > General.  Click the padlock to unlock the preference pane and enter your admin password. Click the Advanced button at the bottom, then see if the option "Log out after N minutes of inactivity" (where N is the number of minutes) is enabled.
        2.    Open System Preferences > Energy Saver and configure Display Sleep to occur after the account is logged out, by dragging the slider to a number of minutes that is greater than N was set to in the previous step.
    Important: If automatic log out is not needed, disable "Log out after Nminutes of inactivity" in System Preferences > Security & Privacy > General. This will also prevent the issue.
    http://support.apple.com/kb/TS4135?viewlocale=en_US

  • Every time I add a page to my documents, my buttons reset. How can I prevent this from happening?

    I am using InDesign CS5. I have a very large document (698 pages) that has several buttons saved on each page.
    I used the automated Table of Contents feature to create all of the destinations. Using the buttons dialog box, I select the specific page the document needs to go to.
    I need to add pages to this document, but every time I add a page, all of the bookmarks default to the very first link in the list. How can I get prevent this from happening?
    If I can't stop this from happening because I used the TOC feature to create the destinations, how can I quickly and easily move forward to add pages to the document. These pages will be inserted throughout the document.
    Thank you.

    Put on shoe.
    Take one shoe-lace in each hand.
    Lay them across each other.
    Then place one of them under the first.
    You now have the first fasting.
    To make the loops, again take each shoe-lace in each hand.
    Fold one of them double into a loop and hold the loop with the other hand.
    Take the second shoe-lace and fold it around the loop and insert the second loop in the space you just created under the first loop.
    Fasten the loops by dragging them in opposite directions.
    How did I do? Clear enough? (English is not my first language by the way).

  • Everytime i press and hold my left click mouse button, it automically highlights everything from that point to the top of the page

    Every time i press and hold my left click mouse button, it atomically highlights everything from that point to the top of the page. Also note, if i'm holding the left click on the scroll bar it goes back to the initial location even when i try to drag it up or down.
    Opened up internet explorer and the problem does not occur there.

    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that turns off some settings, disables most add-ons (extensions and themes).
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu:
    *In Firefox 29.0 and above, click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    *In previous Firefox versions, click on the Firefox button at the top left of the Firefox window and click on ''Help'' (or click on ''Help'' in the Menu bar, if you don't have a Firefox button) then click on ''Restart with Add-ons Disabled''.
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".<br>
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''

  • I went to import special characters in imovie '11 and now the character window comes up on every application, yet won't open in iMovie at all, it flashes across every screen on each key/mouse click

    I went to import special characters in imovie '11 and now the character window comes up on every application, yet won't open in iMovie at all, it flashes across every screen on each key/mouse click, stops the other software from running, and won't shut off, ever.

    Try trashing the .plist in Home/Library/Preferences which has CharacterPalette in its name.

  • I was wondering if there is a way to shut off the install mode on my G3 every time I plug in the USB to my Mac. I have an android manager software Mobile Go that this seems to be preventing it from connecting

    I was wondering if there is a way to shut off the install mode on my G3 every time I plug in the USB to my Mac. I have an android manager software Mobile Go that this seems to be preventing it from connecting

        as62467 We appreciate your G3 question! Let's see how we can help. What you are able to adjust is the USB connection mode by going to the home screen and selecting'recent apps' (in the touch keys bar), settings,storage, the menu (the 3 tiny dots) and tap usb pc connection. If you do not want the software to try and install choose either the internet connection or camera option. Let us know if this helps.
    SheritaH_VZW
    Follow us on Twitter

  • I allow my grandchildren to play free games on my ipad that I download for them.  Is there a way to prevent them from accidentally (or otherwise) purchasing upgrades?  My 6 yr old just did so and has no idea how she did it.  Can I block this access?

    I allow my grandchildren to play free games on my ipad and iphone that I download for them.  Is there a way to prevent them from accidentally (or otherwise) purchasing upgrades?  My 6 yr old just did so and has no idea how she did it. Is there a setting that would prevent this from happening?

    Yes.  You can set restrictions.
    This is covered in the manual.
    iPhone User Guide (For iOS 5.0 Software)
    iPad User Guide (For iOS 5.0 Software)

Maybe you are looking for

  • Using Multiple MIDI controllers at the same time

    It seems that there is no way to record from 2 different midi controllers at the same time without the data getting summed together. I'm trying to record a midi keyboard playing a piano sound and my roland v-drums at the same time. The result i get w

  • Positioning of 'Alerts' in Forms 6i

    Hi folks, I am facing a problem , in my webforms which vary in their heights , whenever the alerts (both user-defined as well as system generated) are shown its very uncertain what will be actually the position of the alerts on the screen and most of

  • Lync 2013 stopped working after update

    Lync starts up fine, but when I click a contact or receive a message, Lync crashes I already updated and repaired office. I do have office 2010 and 2013 installed, but 2010 doesn't have Lync so there shouldn't be a conflict there. Event logs: Log Nam

  • I have not received my email with a serial number/redemption code for a photography subscription.

    does anyone know how to contact Adobe to resolve this issue? I am in India and cannot call them, additionally their chat system is down. I have checked all the relevant help sections for this issue. It is really frustrating because I have all these p

  • GUI Login to System "Waiting for Response"

    Dear all, I´ve installed a new SAP-System with ABAP and JAVA. The installation was successfull, but when I want to login to the System the GUI write "Waiting for Response". That´s all. Can anyone help me?