How can I prevent the Alt key from being pressed in Dash Home while my Java application is running in Ubuntu?

I am learning Slick2D, which serves my purposes of 2D Java programming perfectly. Sorry, I have a problem. I don’t think this is Slick2D specific, since I think the same thing happens with Java Graphics 2D.

In Ubuntu (I use Ubuntu 12.04), pressing the Alt key shows "Dash Home", the same as clicking the top left icon on the screen (Windows users "Dash Home" is a kind of "Start menu).

When my application starts, the Alt key still has this behavior and shows Dash Home. When my game is running in windowed mode, this is not very important, as I can go into a pause state. However, when in full-screen mode this is a big problem, because the system leaves full-screen mode, and switching between full-screen and window windows takes a lot of time and, roughly speaking, ugly.

So the question is: how can I prevent the Alt key from being pressed to access the OS without opening Dash Home? In my code, I process keyPresses through a listener provided by Game2D, and I don't call any superclass method, so presumably keypress should not be reported to the OS. But it is so.

I am not attaching any code since I do not think this is related to Slick2D, but a common problem with Java. Any idea?

Thanks!

Edit: The problem still persists. I have placed here all the source code and binaries of the project here . If this does not help to find a solution to this issue, it can serve as a basic Java programming guide for other people.

+6
source share
1 answer

If you are not trying to publish this java program for downloading people on Ubuntu computers, you can try the following:

Open the System Settings application by going to the Session Indicator panel in the Unity panel or by searching for system parameters using the HUD.

enter image description here

Then go to Keyboard> Shortcuts> Launchers. You can override the HUD key with the key to show the HUD parameter. Pressing Backspace will completely disable the HUD shortcut.

enter image description here

If you set it to the “Alt” position manually, the setting will be different from the left and right Alt keys. Therefore, if you want to maintain general behavior and still use Alt combinations, this might be an alternative solution for you.

And just so that you know that I received this answer from this site: https://askubuntu.com/questions/122209/how-do-i-modify-or-disable-the-huds-use-of-the-alt -key

I generally don’t know how to temporarily disable Alt functions, but if you don't mind it, I hope this helps

+3
source

Source: https://habr.com/ru/post/971021/


All Articles