Disable Alt key in Raspbian entirely - linux

I am looking to develop the raspberry pi into something that I would be able to run a free use public web terminal which would be locked to a certain domain. This is for my employer, a township, who wants to set up terminals around the township so that the less fortunate in our community will be able to contact and interact with the various services that the township provides without having to find a way to the Administration center.
I have been able to get most of what I want working, but I want to disable the Alt key on the keyboard. This will stop users from being able to Ctrl+Alt+Del or Alt+F4 out of the browser environment, and various other features of LXDE that smart users could use to break my kiosk (like virtual terminals). I thought that I had found the method to do this, with xmodmap, but when I ran this command
xmodmap -e "keycode 204 = "
Which to my knowledge should set all mappings for the right Alt key to nothing, still lets me Alt+F4 in chromium and other things.
I also attempted to edit my ~/.config/openbox/lxde-rc.xml and change the keyboard bindings in it. I was able to disable the Ctrl+Alt+Del through that, but when I change or erase other key bindings in there, nothing happens. So I'm trying to figure out other options I have to disable the Alt key on this application. Any ideas?

Soo, I actually just answered my own question. Fixing the problem indeed lies in the ~/.config/openbox/lxde-rc.xml file, but I was not doing it right. To set the Ctrl Alt Delete option, you need to change the value between <command></command> to false (or a program that pops up a finger wag to the user).
The problem was, only four or so of the keys entries have a <command> field to them, and all of the other use an <action="whatever"></action> field to define the action that is being performed by the key. I was changing the value of "whatever" to false and was under the impression that would have the same effect as changing the command field.
But really, what you need to do is change the value of "whatever" to "Execute", and then nest a set of <command></command> with a value set to false and it will set the key's mapping to false. I guess there must be a set of default values that are used to override improper changes to the lxde-rc.xml files, and that's why things kept working after removing the entries.

Related

Manjaro linux compose key gives incorrect behavior

I installed Cinnamon Manjaro linux on my 2017 QWERTY Macbook Air. Kernel: 5.4.27-1-MANJARO.
I've tried changing my keyboard languages, but my compose key always produces the same behavior -- that of a US (intl) keyboard. I don't know why.
I've tried setting my compose key to different things, like LWin or RAlt, no luck.
Ideally, I want the same key behavior as that on Mac. My current keyboard layout is English (Macintosh). Everything works, except for all of the compose key combos / accents, which all seem to produce US(intl) dead key outputs.
Things I've tried:
changing my keyboard layouts, from GUI to setxkbmap.
changing my compose key
manually setting the value of Option "Xkblayout" "mac" in /etc/X11/xorg.conf.d/00-keyboard.conf
Failing to understand how to manually force set the accent keys I want via xmodmap :(
Thanks for the help.
Solved: I realized that there was another keyboard which Xorg was somehow (I don't know how) set to, other than English (Macbook). I ran setxbmap -option which had the effect of "resetting" my keyboard to the layout I'd correctly chosen via the GUI.
I don't much understand how / why Xorg persisted in using another keyboard layout despite what I had entered in the GUI keyboard settings -- somehow it survived a reset through multiple computer restarts throughout these past days. But it works.

Can I disable autocomplete with Alt+Tab on Qt Creator under Linux?

For the most part I very much like Qt Creator, but a few projects I'm working on require me to switch between my editor and my web browser for reference. Qt Creator is currently interpreting Alt+Tab to autocomplete, and then switching my window focus; this is a mild problem but it's really starting to get to me.
I've tried going to Tools→Options→Keyboard and searching for Alt+Tab, but found nothing. Is there a way to get it to selectively ignore the key combination without disabling autocomplete on the whole?
To complete the picture, I'm on Linux Mint 19.04 using XFCE desktop environment; or occasionally Maté. If I need to access something in system settings to do this I'm happy to; I just don't want to keep excessively second-guessing my code when I return to it.
Auto-complete is bound to Ctrl+Space by default, not Alt+Tab. In tools/options/keyboard, search for "CompleteThis" to see what it's bound to.
Maybe what you want is to disable auto-complete and use only manual-complete? That is, have the auto-complete list only show when you press ctrl+space, but never automatically. You can do that in options/text editor/completion.

Catching special characters with ncurses

I am currently working on a project for mapping every possible keyboard and mouse interrupt.
The mapping is done in linux environment and with ncurses library.
The question is how to catch the following keyboard keys :
Home
End
page up / down
when pressing those keys the terminal itself is catching them and the program itself cant see them (spent a few hours of configuration and found no solution yet)
pause/break (above page up in standard keyboard)
PrtScreen
Num Locked keys (0 to 9 and < . >).
Windows button
the following just not getting any response at all, neither from the terminal or the program.
short: you cannot catch all keys with ncurses
long: the usual problems lie in a failure to initialize things properly:
you probably forgot to call keypad(stdscr,TRUE) (or whatever window you might be using with wgetch). That will allow an application to read any of the keys defined in the terminal description as an integer.
If it is not in the terminal description, (n)curses will return the sequence of bytes which make up the key as sent from the keyboard.
That's two likely problems. There are other keys (or combinations of keys) which the terminal will not send (in a way which makes distinct keyboard sequences). For instance, using the Control key with other keys may change the sequence sent by the keyboard, or it may not. To see this, use experiment with the control key with comma, period or the other punctuation keys in that area of the keyboard.

Change Keyboard Mapping

Hello and thank you in advance,
I am wondering if there is a way to change the layout of my keyboard (software-wise).
The problem is that, on my laptop's keyboard, the Page Up and Page Down keys are combined with the Home and End keys respectively (i.e. to use Home, I have to use the command fn+PgUp/Home).
Is there a way for me to switch what my keyboard receives in Windows 8? If I press the PgUp/Home key I would like the Home command to be entered, and if I entered fn+PgUp/Home I would like the PgUp command to be entered.
I have tried googling for this using several different keywords, but haven't been able to find anything.
Any help is appreciated,
Zach
This is a duplicate question.
You can find an answer here:
https://superuser.com/questions/694465/remapping-a-keyboard-key-in-windows-8-1
Keep in mind this does require registry edits which can be dangerous and can lead to critical failures if not done correctly. Always create a restore point before making any registry edits.

What could be causing Vim to switch keymaps randomly?

I've noticed a problem with Vim, where the keyboard mapping would unexpectantly change (to French I think, but I'm not sure). For example, the character 'É' appears when the key '?' is pressed.
My keyboard is set to English, and I don't have any other languages on my computer.
Restarting Vim fixes this problem temporarily, but the problem reappears after a while.
What could be causing this, and what can I do to fix it?
I found this blog post on the same problem. Apparently left-alt + shift will do it. Removing that from the Windows "Advanced Key Settings" dialog and/or removing all unwanted keymaps should fix the problem.
I am not on a Windows system at the moment so cannot verify this.
Update
I have tried it on a Windows system and can verify that this is the problem - alt+shift defaults to cycling through the all the keyboard configurations.
It can be changed from (deep breath...)
Control Panel -> Regional & Language Options -> Languages Tab -> Details button -> Key Settings -> Switch between input languages
Unselect both tickboxes on the final dialog.
I find it astonishing that anyone at Microsoft thought it would be a good idea to have a simple key combination that silently changes the keyboard mapping and other language settings, and only for the current program. How often has anyone wanted to do that?

Resources