date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,471,004,309,000 |
I'm using GNU Emacs 23.2.1. within Xfce 4.8.0 (both coming from the Ubuntu Natty repository). I disable the CapsLock by running /usr/bin/setxkbmap -option "ctrl:nocaps" at the beginning of the Xfce session.
When I hit the CapsLock key with some other keys, Emacs treats it as if the Ctrl key and the Shift key is pressed (Ctrl-S-whatever). This has some unpleasant effects such as moving cursors always setting marks, and translating Ctrl-h to Ctrl-? not working.
Pressing the real Ctrl key on the keyboard works fine, and pressing both the real Ctrl and Shift key works the same way as pressing the real CapsLock key only.
I'd like the CapsLock to be precisely same as the Ctrl key. What should I do? I tweaked the X server setting in vain, so I think I might want to make Emacs treat Ctrl-S-whatever as Ctrl-whatever.
|
I use xmodmap and it work fine. Install xmodmap and have xmodmap .xmod autostart.
Content of .xmod.
remove Lock = Caps_Lock
keycode 66 = Control_L NoSymbol Control_L
add Control = Control_L
Maybe your keycode is different.
| Disabling caps lock by setxkbmap makes it Shift key in Emacs |
1,471,004,309,000 |
I'm running vnc4server on an Ubuntu 10.10 box, and connecting to it from an Ubuntu 8.04 machine using TightVNC Viewer 1.3.9. I'm unable to type anything with the character d within the VNC session, as the d causes all windows to be minimised.
Following reports of a successful solution on many online fora, I disabled the keyboard shortcut for hiding all windows, but the problem persists.
Output of xev is given below. It includes two presses of d because the first press minimised all windows. I didn't know what to keep and what to remove, so this output includes everything from the first key-press to when the windows came back up on the second key-press:
FocusOut event, serial 29, synthetic NO, window 0xa00001,
mode NotifyGrab, detail NotifyAncestor
FocusOut event, serial 29, synthetic NO, window 0xa00001,
mode NotifyWhileGrabbed, detail NotifyNonlinear
FocusIn event, serial 29, synthetic NO, window 0xa00001,
mode NotifyWhileGrabbed, detail NotifyPointer
KeymapNotify event, serial 29, synthetic NO, window 0x0,
keys: 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
LeaveNotify event, serial 29, synthetic NO, window 0xa00001,
root 0x2e, subw 0x0, time 581275388, (100,64), root:(111,572),
mode NotifyNormal, detail NotifyAncestor, same_screen YES,
focus YES, state 0
UnmapNotify event, serial 29, synthetic NO, window 0xa00001,
event 0xa00001, window 0xa00001, from_configure NO
PropertyNotify event, serial 29, synthetic NO, window 0xa00001,
atom 0xc7 (WM_STATE), time 581275388, state PropertyNewValue
PropertyNotify event, serial 29, synthetic NO, window 0xa00001,
atom 0xae (_NET_WM_STATE), time 581275388, state PropertyNewValue
MapNotify event, serial 29, synthetic NO, window 0xa00001,
event 0xa00001, window 0xa00001, override NO
VisibilityNotify event, serial 29, synthetic NO, window 0xa00001,
state VisibilityUnobscured
Expose event, serial 29, synthetic NO, window 0xa00001,
(0,0), width 178, height 10, count 3
Expose event, serial 29, synthetic NO, window 0xa00001,
(0,10), width 10, height 58, count 2
Expose event, serial 29, synthetic NO, window 0xa00001,
(68,10), width 110, height 58, count 1
Expose event, serial 29, synthetic NO, window 0xa00001,
(0,68), width 178, height 110, count 0
EnterNotify event, serial 29, synthetic NO, window 0xa00001,
root 0x2e, subw 0x0, time 581276874, (100,64), root:(111,572),
mode NotifyNormal, detail NotifyAncestor, same_screen YES,
focus NO, state 0
KeymapNotify event, serial 29, synthetic NO, window 0x0,
keys: 4294967283 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PropertyNotify event, serial 29, synthetic NO, window 0xa00001,
atom 0xc7 (WM_STATE), time 581276874, state PropertyNewValue
PropertyNotify event, serial 29, synthetic NO, window 0xa00001,
atom 0xae (_NET_WM_STATE), time 581276874, state PropertyNewValue
FocusIn event, serial 29, synthetic NO, window 0xa00001,
mode NotifyWhileGrabbed, detail NotifyNonlinear
KeymapNotify event, serial 29, synthetic NO, window 0x0,
keys: 68 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
FocusOut event, serial 29, synthetic NO, window 0xa00001,
mode NotifyUngrab, detail NotifyPointer
FocusIn event, serial 29, synthetic NO, window 0xa00001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 29, synthetic NO, window 0x0,
keys: 4294967214 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
The problem is solved now. I had made the silly assumption that the key bindings were global when in fact, they are per-user. I had changed the key bindings logged in as root, but was logging into a VNC session created by another user. The 'hide all normal windows…' shortcut was set to Mod4+D for this user. The standard solution—changing it to something else, such as Ctrl+Alt+D—fixed the problem.
| 'd' Key on VNC Viewer Minimises All Windows |
1,471,004,309,000 |
I'm currently using xmodmap to remap some keys, keeping my configuration in a .Xmodmap file, but every time I boot my laptop, or my screen locks, the customization is lost and I have to run xmodmap ~/.Xmodmap once again, even though I set the command to execute on startup and in the ~/.xinitrc file too.
I've rummaged about forums looking for information on setxkbmap, but I can't really understand what's going on, and have trouble trying to remap some keys.
For example, the key on the right of my Right Alt key, when pressed under xev, looks like this:
KeyPress event, serial 37, synthetic NO, window 0x2600001,
root 0x6a8, subw 0x0, time 14892208, (674,389), root:(848,553),
state 0x0, keycode 97 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
1 - So we have keycode 97 and keysym NoSymbol. How would I map that to be Right Control using setxkbmap?
2 - Also, how can I remap the Ctrl + Arrow Keys to work like Home / End / PgUp / PgDown?
Most importantly, I want to make these changes permanent.
3 - Lastly, is there any comprehensive content or documentation about this program out on the web?
Thank you very much for your time and attention.
|
I don't have enough reputation to leave a comment. The following AskUbuntu question has an accepted answer (that references xmodmap) and other answers which have some good feedback, which may answer your question (even if:
https://askubuntu.com/questions/749660/how-can-i-persistently-remap-keys-in-ubuntu-16-04
For your other questions, not using setxkbmap, but using xev and xmodmap , I posted some useful information tonight on https://unix.stackexchange.com/a/727560/282315 which might answer most of these.
For full documentation, you can type in to a terminal man <PackageName> e.g. man xmodmap
As these are SE sites, I'm not going to copy the information to this answer, to keep the original answers in their original question.
For the key combinations, you could have a look at Menu >> Keyboard. There's a 'Shortcuts' section where you can create your own. I'm not sure a Ctrl+Up/Dn can work to do PgUp/PgDn, you might need to look at using macros (like AutoKey sudo apt install autokey-gtk - desktop automation utility). But if you currently have to press a function key to get the PageUp (e.g. Fn+Up), there should be a Function Lock key to reverse the functions if you use them all the time, it could be a padlock that you Fn+Lock and it switches them around.
| How to use setxkbmap to map keys permanently? |
1,471,004,309,000 |
I am currently running "Linux Mint 18.3 Sylvia" with the Desktop Environment "xfce4".
Because I have to setup several PCs, I want to write a bash script, that configures the keyboard shortcuts for the system.
I did some research, but none of these articles were what I was searching for. Here for example the author is using Cinnamon as DE, so the given filepath (/org/cinnamon/desktop/keybindings/) does not exist on my system.
In this article the author is using the program dconf-cli. But i don't want to use an external application. I really want to know, where on my system, these shortcuts will be saved.
|
You're looking for $XDG_CONFIG_HOME/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
Replace $XDG_CONFIG_HOME with ~/.config if you don't have it as an environment variable.
You'll find the user configuration files for most XFCE4 applications in that $XDG_CONFIG_HOME/xfce4 folder, so you might want to simply copy that over for your DE configuration to be consistent between devices.
As an aside, the mentioned path /org/cinnamon/desktop/keybindings/ isn't meant to be an actual file on your filesystem.
It's a path stored in the dconf database, which you can find at $XDG_CONFIG_HOME/dconf/user
It's unfortunately not plaintext, and as such not very easy to manipulate without using the dconf command
| Where are the Linux Mint xfce keyboard shortcuts saved? |
1,471,004,309,000 |
I've updated to Fedora 26 and now my Capslock key behaves strangely (or not at all). In Fedora 25 the xkb setting worked perfectly for both my Ctrl and Caps changes. I've selected "Caps as Ctrl" in Gnome Tweak Tools, but Caps just does nothing at all!
Using xev I get the following output for the caps key:
KeyRelease event, serial 36, synthetic NO, window 0x2600001,
root 0x273, subw 0x0, time 2293119, (164,-21), root:(271,94),
state 0x10, keycode 66 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
the bracket after keycode should contain LCtrl instead of NoSymbol. I've also tried deactivating and or activating Caps. As well as that I've tried to modify /usr/share/X11/xkb/keycodes/evdev and use Caps = 37; which would make Caps similar to Left Control - but this as well has no effect whatsoever.
Please help me - since wayland I'm kinda lost here!
I've also changed Left Control and Alt by:
<LALT> = 37; //64;
<LCTL> = 64; //37;
In the previously stated file -> this still works like a charm!
|
I temporarily (hopefully this will get some love) fixed it:
In gnome tweak tools under Typing I deselected every entry, but "Capslock is also Control". No idea why the program lists many options as duplicates like
"Capslock - Disabled" and "Capslock is disabled" and most of them are ambiguously labeled, such that capslock-control is modified by many options.
| Map Capslock to Control on Wayland |
1,471,004,309,000 |
I have 3 USB-keyboards attached to the Linux. Normally, when writing on any one, the characters "going" to the currently active application, e.g. to terminal or any other app.
But, me reading the keyboard events from two keyboards directly by reading the particular /dev/input/eventX devices using some Perl module. While the script reads and decodes all events correctly, the entered keys are also going into the active application.
The question is: It is possible to stop routing the keyboard events from particular keyboard to the active application? E.g. somewhat tell to kernel that inputs from a particular keyboard should not be taken as normal keyboard input.
Because the X11 reads from every device which has device nodes in the /dev/input/event* it kooks like there are two possible solutions:
Somewhat change the name of the USB "keyboard" to another name instead of eventN, for example /dev/input/myinput0. Unfortunately, the udev rules doesn't allows renaming the device. (The NAME directive in the rules.d works only for network devices, for other devices could create only symlink)
Somewhat change the X11 configuration, in the /usr/share/X11/xorg.conf.d/10-evdev.conf, to ignore some particular "keyboard-like" devices - e.g. don't read every eventN device. Currently in my system it contains:
Section "InputClass"
Identifier "evdev keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection
Do you have any idea how to do any of the above?
The real background: I have attached two USB-RFID readers. They act as keyboards, e.g. when I touching the reader with the RFID-tag, it sends the RFID-number exactly as they was typed on the keyboard, e.g the readers act like a normal keyboard.
My application could read the RFID events (in the background), and (of course) I don't want get the characters from RFID into the active window.
|
If you are reading from /dev/input/eventX anyway, just do an EVIOCGRAB ioctl on it. You can issue ioctl's in Perl easily. Don't forget to release the grab when your program quits.
The grab will prevent all other devices, including X, from reading events from this device.
That's cleaner than xinput, because you also exclude other applications that may want to read directly from the device, and you also can control the duration of the exclusion (as long as your application runs).
| How to prevent the keyboard from being interpreted by the current application? |
1,471,004,309,000 |
I'm trying to remap different keys (for example, I want the "Y" to be "space"). XKeyCaps let me choose the keyboard, and shows correctly when one key is pressed. But the right click menu that allows to do the changes shows up but doesn't work (it stays up as long as the right mouse button is clicked, options are not grayed, but nothing can be selected).
I'm using Fedora 20 with KDE.
|
The issue may be resolved by deactivating Num- or Caps-Lock, as is stated in the XKeyCaps manual:
"If you can't select anything from the right-button popup menu, it
might be because you have NumLock or CapsLock down. I'm not sure how
to fix this, it seems to be some dumb Xt thing."
Alternatively:
"If the popup menu is always greyed out, or doesn't correspond to the key that you clicked on, it might be because you're running xswarm, an old version of xautolock, or some other program that antisocially interferes with event-propagation. (Don't go like that.)"
| How to remap the keys with xkeycaps? |
1,471,004,309,000 |
I want to remap some keys on my keyboard, specifically: page up key to home and page down to end.
On previous versions of GNOME 3 I just created a .xinitrc file that contained:
cat .xinitrc
xmodmap -e "keycode 117 = End"
xmodmap -e "keycode 112 = Home"
and that was all.
On GNOME 3.8.4 this file takes no effect, and I have to manually: bash .xinitrc, moreover xmodmap settings are lost when I restart gnome shell (which I do sometimes because of a GNOME 3 bug), and also are lost spuriously from time to time.
What is the proper way to remap keys when using GNOME 3.8?
|
Sourcing commands during login
I've not tried either .xinitrc or .xsession files to do this, but I have done it using a custom launcher that gets run when I login. You can access the dialog that allows you to do this a couple of ways, I usually just launch it from the command line like so.
$ gnome-session-properties
The GUI looks like this.
From here you can create your own custom startup launchers and then point them to shell scripts that contain what ever commands you need to invoke. Here I've created my own Dropbox launcher script that gets executed when I log in.
Mapping keys to run commands
If on the other hand you're looking to create shortcut key combinations that will launch commands, I've successfully been using XBindKeys on GNOME 3.8.4 for this very purpose.
My use has been modest but I like to create keyboard shortcuts for Nautilus to launch with certain directories opened.
Example
You'll need to first make sure the packages xbindkeys is installed.
Then you'll need to run the following command, one time only, to create a template xbindkeys configuration file.
$ xbindkeys --defaults > /home/saml/.xbindkeysrc
With the file created you can open it in a text editor and add a rule like this:
"nautilus --browser /home/saml/projects/path/to/some/dir"
Mod4+shift + q
With the above change made we need to kill xbindkeys if it's already running and then restart it.
$ killall xbindkeys
$ xbindkeys
Now with this running any time I type Mod+Shift+Q Nautilus will open with the corresponding folder opened.
Why isn't .xsession or .xinit getting sourced
I believe the ultimate issue lies with this post, titled: Quickly Setting up Awesome with Gnome. It discusses methods for getting GDM (GNOME's Display Manager) into loading these files, which to me implies that it doesn't by default.
My Fedora 19 system contains this file: /usr/share/xsessions/gnome.desktop which contains these lines:
Exec=gnome-session
TryExec=gnome-session
Icon=
Type=Application
I believe gnome-session doesn't source your .xsession file by default, and the .xinit is meant to be sourced if you invoke GNOME using startx.
Be sure to look through the section titled: with GDM, which shows this in more details.
References
Detect if mouse button is pressed, then invoke a script or command
XBindKeys
| Remap keys on GNOME3.8 using xmodmap? |
1,471,004,309,000 |
I'm trying to set my HP Pavilion g6 keyboard layout to English(us) and Arabic(ara).
I'm using Fedora 18, but followed Arch Wiki anyways.
Here's my 90-keyboard-layout.conf file :
Section "InputClass"
Identifier "keyboard"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "XkbModel" "pc105"
Option "XkbLayout" "us,ara(qwerty_digits)"
Option "XkbVariant" "qwerty_digits,qwerty_digits"
Option "XkbOptions" "grp:alt_shift_toggle"
EndSection
I've entered pc105 because I have no idea what's the corresponding XkbModel for my HP Pavilion g6 keyboard (looked in /usr/share/X11/xkb/rules/xorg but didn't find it).
I have also this file 00-anaconda-keyboard.conf which contains :
#This file was generated by the Anaconda installer
Section "InputClass"
Identifier "keyboard"
MatchIsKeyboard "on"
Option "XkbOptions" "terminate:ctrl_alt_bksp,"
EndSection
Section "ServerFlags"
Option "DontZap" "false"
EndSection
Here's my setxkbmap -print:
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us(qwerty_digits)+ara(qwerty_digits)(qwerty_digits):2+inet(evdev)+group(alt_shift_toggle)+terminate(ctrl_alt_bksp)" };
xkb_geometry { include "pc(pc104)" };
};
What else is missing? Layout switching is not working at all so far.
|
Edit your 90-keyboard-layout.conf like this:
Section "InputClass"
Identifier "keyboard"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "XkbModel" "evdev"
Option "XkbLayout" "us,ara"
Option "XkbVariant" ",qwerty_digits"
Option "XkbOptions" "grp:alt_shift_toggle"
EndSection
| Trying to set keyboard layout using Xorg configuration but it's not working |
1,471,004,309,000 |
I'm in Linux (Fedora 17 x86_64, 3.6.11) and my laptop's PageUp key has gone ultrasensitive on me. I'd like to disable it (remap it to nothing at all) as I've never liked it where it is (right next to my up arrow keys).
I'm sure that I can use xmodmap to do it, but I don't even know where to start.
** EDIT **
I'd like something like:
keycode 112 = NULL PAGE_UP
|
My biggest problem is in understanding all the opaque terminology they've invented for it. I can see how to remap a single key in its various modified forms, but there's no "IGNORE THIS KEY
In your case "ignore this key" translates to "remap to nothing".
Open a terminal and run:
xmodmap -e 'keycode 112='
your PageUp key will suffer a sudden death.
Re-enable it with:
xmodmap -e 'keycode 112= Prior'
To permanently disable it add:
keycode 112=
to your ~/.Xmodmap
Test your config file:
xmodmap ~/.Xmodmap
| How to clear keybinding |
1,471,004,309,000 |
I would like to detect if a key is being pressed when running a script. I have the following script:
#!/bin/bash
sleep 0.5
xte 'str sometext'
I run this script using a shortcut to paste "sometext" where I'm at in kde. I used a sleep 0.5 here because the script itself is run with a shortcut that uses ctrl and alt. If the sleep 0.5 is omitted, the result is that ctrl+s, ctrl+o, etc... is sent. I think the solution would be to add some bussy wait at the beginning that would block untill no keys are being pressed. How can I get this to work in the script?
|
Since you are using xte anyways, why not release the keys with xte? Something along the lines
xte "keyup Control_L"
xte "keyup l"
(assuming your shortcut is ctrl-l).
| detect if key is pressed from script |
1,471,004,309,000 |
We use the `exceed tool to connect to our UNIX servers, but sometimes the command-line behaves erratically. When I am typing some command on the command-line, nothing happens -- nothing is displayed on the screen and I need to close the terminal and open a new one. Why does that happen?
Is it related to stty sane? I have typed stty sane thinking that it is used when your command-line starts behaving erratically; is that what it's for?
|
I'm not sure if it is what is happening in your case, but pressing Ctrl+S will freeze the tty, causing no updates to happen, though your commands are still going through. To unfreeze the tty, you need to hit Ctrl+Q.
Again, I'm not totally sure this is what is happening in your case, but I do this by accident often enough, that it is possible it may affect others as well.
| Keyboard input not displayed on the screen? |
1,471,004,309,000 |
I would like to have the left and right ctrl keys to behave the same.
I already have the left key working as it should, in all the shortcuts, etc., but the right one seems to be completely ineffective.
I have looked in the keyboard layout options, but with no results.
I am on Linux Mint 20.2, with Mate desktop environment.
--addendum--
The result of xev is as follows:
KeyPress event, serial 35, synthetic NO, window 0x5200001,
root 0x7ac, subw 0x5200002, time 416256, (49,43), root:(2600,505),
state 0x10, keycode 105 (keysym 0xff20, Multi_key), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: True
KeyRelease event, serial 38, synthetic NO, window 0x5200001,
root 0x7ac, subw 0x5200002, time 416464, (49,43), root:(2600,505),
state 0x10, keycode 105 (keysym 0xff20, Multi_key), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
The output of xmodmap is as follows:
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25)
mod1 Alt_L (0x40), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
|
I have found a more stable and final solution!
The behavior I want (both ctrl keys, left and right, having the same behavior) is indeed the default.
My problem was that a keyboard setting was changing this default.
I just found this setting, I have de-selected it, and the default (wanted) behavior is obtained!
The setting is reached as follows:
Keyboard preferences -> Layouts -> Options -> Position of Compose key -> Right Ctrl.
Below I report the screenshots:
| How can I have the right ctrl key behave as the left ctrl key? |
1,498,426,566,000 |
When I run any program in wine (e.g. notepad), I can use the keyboard
just fine until I click the mouse. As soon as I click the mouse for any
reason, the keyboard stops working entirely.
I'm using default X.Org settings, and adding --without-xinput2 to Wine
has no effect. I am using a laptop, and plugging in an external USB
keyboard produces the same problem exactly.
There are never any error messages that seem to relate to the keyboard,
but this error message always shows up a few times. It doesn't look
important, but, just in case, here it is:
fixme:event:wait_for_withdrawn_state window 0x30038/1400007 wait timed out
Here are some versions, in case any of this matters:
Wine: 1.3.21
Kernel: 2.6.39 (Gentoo r1)
X.Org X server: 1.10.2
Window manager: musca (0.9.24)
Additionally, in some programs (e.g. StarCraft), the keyboard never
even starts working. In this case, text gets entered into another
program. For example, if I open it from the terminal, anything I type
will appear in the terminal after I quit. I think this might be a
separate issue, though, since that does not happen at all with notepad.
Update: I just noticed that 1.3.21 is a development version of Wine,
so I installed 1.2.3 instead. Disappointingly, the problem persists
exactly as written.
|
The problem was the window manager: musca is a tiling window manager
with a stacking mode, and flipping from tiling mode to stacking mode
resolves the issue completely.
It works even better in regular stacking window managers such as
fluxbox.
| Keyboard (mostly) doesn't work in Wine |
1,498,426,566,000 |
Could you show me how to write macro in xmacro (that will work in whole desktop environment) that is able to expand strings?
E.g. I will type "thx" and it will expand to "thank you".
|
xmacro is a basic macro-recorder/macro-player.. it is good for some things, but is not suited to monitoring your keystrokes dynamically (other than for recording)...
xmacro: Record / Play keystrokes and mouse movements in X displays
You are probably better off using a tool like autokey.. You can find some tutorials at How-To Geek
Autokey Sample Scripts
Autokey Video
Autokey Features:
KDE and GTK versions available, making AutoKey integrate well into any desktop environment.
Write Python scripts to automate virtually any task that can be accomplished via the keyboard
Built-in code editor (using QScintilla in KDE or GtkSourceView2 in GTK)
Create phrases (blocks of text) to be pasted into any program on demand (uses the X selection)
Create collections of phrases/scripts in folders, and assign a hotkey or abbreviation to the folder to display a popup menu
Regular expressions can be used to filter windows by their title, to exclude hotkeys/abbreviations from triggering in certain applications
Scripts, phrases and folders can be attached to the tray icon menu, allowing you to select them without assigning a hotkey or abbreviation
AutoKey can track your usage patterns and present the most frequently used items at the top of the popup menu
| Automating typing strings in xmacro |
1,498,426,566,000 |
On my laptop, when I press the volumeup/volumedown key, the sound lever go up/down by 10 units.
I can check that with alsamixer: when I press volume up, the sound level indeed go up by 10 points.
But I would like these keys to be less sensible: it would be nice if the level could go up/down by 5 points when I press a key (volume up/volume down).
I know that these rules are configured in /lib/udev/hwdb.d, but the only thing I found in these files is the use of the "volumeup" and "volumedown" keywords, but not the amount the button increase/decrease.
How could I do that ?
Is there a config file somewhere ?
Edit
I'm on arch, and I would like to know where the config is stored (if there is one)
I'm using pulseaudio, I don't know if this can help
|
As far as i am concerned this is not a pulseaudio thing and depends on which DE or WM you are using
I have never used a DE with arch but for WM's this is configured in their configuration files like for
i3 (~/.config/i3/config)
#change volume
bindsym XF86AudioRaiseVolume exec amixer -q set Master 5%+
bindsym XF86AudioLowerVolume exec amixer -q set Master 5%-
bindsym XF86AudioMute exec amixer -q -D pulse set Master toggle
for configuration in dwm (go to dwm dir and configure config.h)
#include <X11/XF86keysym.h>
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("amixer -q set Master 5%- ") },
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("amixer -q set Master 5%+ ") },
for qtiles (.config/qtile/config.py)
([], "XF86AudioLowerVolume", lazy.spawn('amixer -q set Master 3%-')),
([], "XF86AudioRaiseVolume", lazy.spawn('amixer -q set Master 3%+')),
| How can I set the amount by which the sound keys increase/decrease volume? |
1,498,426,566,000 |
I've set up a VM with VirtualBox.
The problem is that the guest system doesn't capture all keys. Although, the option Auto Capture Keyboard is set. Keys like Super or shortcuts like Alt+Tab are always handled by the host system and not by the guest as I would expect.
How can I capture all keys (except the Host Key) within the guest system?
Host: Linux arch 4.11.3-1-ARCH #1 SMP PREEMPT Sun May 28 10:40:17 CEST 2017 x86_64 GNU/Linux
Guest: Linux kali 4.9.0-kali4-amd64 #1 SMP Debian 4.9.25-1kali1 (2017-05-04) x86_64 GNU/Linux
|
Changing the XDG_SESSION_TYPE from wayland to x11 solved the problem.
The following line in the /etc/gdm/custom.conf file has to be uncommented:
#WaylandEnable=false
| VirtualBox: How to capture shortcuts in the guest OS? |
1,498,426,566,000 |
Many computer and gaming enthusiasts use special keyboards. One common feature on these keyboards is many custom keys that are meant to be bound to special command specific to games and software.
The software for editing and creating commands that these custom keys trigger is almost always in windows
EX: Tt Esports challenger software Challnger Pro Gaming
When running the software using Wine it is unable to locate the keyboard or other devices, and thus the key bindings cannot be programmed.
For most keyboards custom keys are bound be default to ctrl+c and ctrl+v . So using the System Settings to set these keys would overwrite whenever a user tries to use those commands.
What are possible solutions to this issue, is there a way to let Wine detect hardware or is there another method to set custom keys?
Finding a solution would be very helpful to the Linux community as custom keys could be used when developing or using specialized software.
My keyboard is a HID keyboard, using hid-generic.
For the keys not set by default nothing is registered in evtest but for the three preset values they return
Event: time 1488397338.016750, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1488397338.016750, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
xev only registers the keys preset to ctrl+c and such as 2 keystrokes, the keys not set by default are not registered
I do have a Windows system, where I could sniff the USB protocol. But how would I do it?
|
This will probably take several steps/iterations, and the Q&A format isn't a good fit. Please update your question with more information if you are stuck, and ping me in a comment to this answer. I'll edit my answer then.
From the description it sounds like the mapping of special keys to key events is done in the keyboard, so programming must happen in the keyboard, and not in a driver.
There are various open source USB sniffer for Windows, e.g. usbpcap or the older usbsnoop, google will probably find more, and tutorials how to use them.
In principle, you'll need to record the communication while programming different special keys with different key sequences with the programming software. Then look at the packets, compare them, and see which bytes change for different special keys or programmed sequences. Guess the protocol, replay it in a self-written program using libusb on Linux.
As your keyboard is HID, and HID is highly standardized, we have a bit of help. Familiarize yourself with the HID documentation (or at least look up those parts you need). Each HID device comes with a descriptor, and the descriptor describes all possible interaction with the device according to the HID standard. If this is how the keyboard is programmed, and if there are not too many "vendor-specific" fields, we may guess the protocol directly.
You can read the descriptor in two ways.
(1) If your kernel has debugfs enabled, as root do
mount -t debugfs none /sys/kernel/debug
cat /sys/kernel/debug/hid/device_id/rdesc
where device_id is the id if your keyboard. This will show the raw descriptor as hex bytes, and how the kernel parses it. If the kernel parse is not enough, try hidrd to convert the raw descriptor.
(2) Issue HIDIOCGRDESCSIZE and HIDIOCGRDESC ioctls on the hidraw device (look in dmesg to find it for your keyboard). The samples/hidraw/hid-example.c in the Linux kernel source explains how to do that, or use a ready-made tool like usbhid-dump.
Ideally you'll see some feature or output description(s) that is/are related to the programming. You may still have to snoop the software tools if too many of the described fields are unclear or marked "vendor-specific".
| Gamer keyboard with custom keys |
1,498,426,566,000 |
In windows 7 using Windows Key + Left or Right arrow makes a window take up half the screen.
XFce 4 has the ability to tile either two windows side by side or 4 windows one in each of four corners (bottom left, bottom right, top left, top right).
Is it possible to add keyboard shortcuts so that you can move windows into these six positions:
(take up left half, take up right half, bottom left, bottom right, top left, top right)?
|
If you use other window managers with XFCE you can manipulate windows in many ways you don't currently have with XFWM. Compiz in particular with the grid and put plugins give you shortcuts to place windows in various positions like a tiling window manager. You'll want to install ccsm (compiz config settings manager) to manage plugin settings and set your shortcuts.
| keyboard shortcuts for placing an xfce4 window into the corner |
1,498,426,566,000 |
I am trying to use Xmodmap to add some german diareses/umlauts to my keyboard, but Xmodmap is not working with them (but is with other remappings).
I am following this guide: German Umlauts on US Keyboard in X (Ubuntu 10.04).
Xmodmap
I have added this to my ~/.Xmodmap:
keysym a = a A adiaeresis Adiaeresis
keysym o = o O odiaeresis Odiaeresis
keysym u = u U udiaeresis Udiaeresis
keysym s = s S ssharp ssharp
xev
However it doesn't work. Here's the output from xev when I press o, hold down AltGr, press o, press x:
KeyPress event, serial 34, synthetic NO, window 0x4e00001,
root 0x8e, subw 0x0, time 642618, (108,138), root:(173,190),
state 0x10, keycode 32 (keysym 0x6f, o), same_screen YES,
XLookupString gives 1 bytes: (6f) "o"
XmbLookupString gives 1 bytes: (6f) "o"
XFilterEvent returns: False
KeyRelease event, serial 37, synthetic NO, window 0x4e00001,
root 0x8e, subw 0x0, time 642644, (108,138), root:(173,190),
state 0x10, keycode 32 (keysym 0x6f, o), same_screen YES,
XLookupString gives 1 bytes: (6f) "o"
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x4e00001,
root 0x8e, subw 0x0, time 643792, (108,138), root:(173,190),
state 0x10, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
XKeysymToKeycode returns keycode: 92
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x4e00001,
root 0x8e, subw 0x0, time 645365, (108,138), root:(173,190),
state 0x90, keycode 32 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 37, synthetic NO, window 0x4e00001,
root 0x8e, subw 0x0, time 645409, (108,138), root:(173,190),
state 0x90, keycode 32 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x4e00001,
root 0x8e, subw 0x0, time 647660, (108,138), root:(173,190),
state 0x90, keycode 53 (keysym 0xd7, multiply), same_screen YES,
XLookupString gives 2 bytes: (c3 97) "×"
XmbLookupString gives 2 bytes: (c3 97) "×"
XFilterEvent returns: False
KeyRelease event, serial 37, synthetic NO, window 0x4e00001,
root 0x8e, subw 0x0, time 647722, (108,138), root:(173,190),
state 0x90, keycode 53 (keysym 0xd7, multiply), same_screen YES,
XLookupString gives 2 bytes: (c3 97) "×"
XFilterEvent returns: False
KeyRelease event, serial 37, synthetic NO, window 0x4e00001,
root 0x8e, subw 0x0, time 650223, (108,138), root:(173,190),
state 0x90, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
XKeysymToKeycode returns keycode: 92
XLookupString gives 0 bytes:
XFilterEvent returns: False
You'll note that pressing AltGr is interpreted as ISO_Level3_Shift, and when that and x is pressed, I get keysym 0xd7, multiply, i.e. ×, which is set as my 3rd level for x. So AltGr works.
$ xmodmap -pke | grep 53
keycode 53 = x X x X multiply approximate
However when I press o I get keysym 0x0, NoSymbol, despite my 3rd level set up:
$ xmodmap -pke | grep 32
keycode 32 = o O odiaeresis Odiaeresis
Same thing happens when I try to use AltGr + (a|u|s).
Xmodmap works for other remappings
Since my PgUp key on my laptop is small, I have remapped the num pad + to by Page Up in my ~/.Xmodmap, and that works fine. So my XModmap file is being (partially) read.
Why does my reassigments to o/a/u not work?
I am using Ubuntu 14.0.1 trusty with Ubuntu Unity.
|
Preliminary note: it appears that xmodmap has recently changed; old settings won't work.
For your case, look at the number of values for keycode 53 (6 values: x X x X multiply approximate), which works, and for keycode 32 (4 values: o O odiaeresis Odiaeresis), which doesn't work.
ISO_Level3_Shift will select the 5th or 6th value, but they are not set for keycode 32 in your case. Hence the keysym 0x0, NoSymbol result.
What you need is:
keysym a = a A a A adiaeresis Adiaeresis
keysym o = o O o O odiaeresis Odiaeresis
keysym u = u U u U udiaeresis Udiaeresis
keysym s = s S s S ssharp ssharp
But it may better to use XKB directly (example).
EDIT: The 3rd and 4th values are selected by the Mode_switch key. And for each pair of values, Shift selects the second value of the pair. See the ArchWiki xmodmap page.
| xmodmap keybindings don't work |
1,498,426,566,000 |
I have a program that takes input from the keyboard and presents a nice visualization. The purpose of the program is so that my infant can mash on the keyboard and get the computer to do something.
However, I would like to write a keyboard input sanitizer that is disjoint from the main program. Conceptually, I would want the program have the functionality:
sanitize_keyboard_input | my_program
Where my_program thinks it is getting input from the keyboard but it is really getting input from sanitize_keyboard_input. Is there a way to do this? I am running Ubuntu linux if that helps.
|
I wrote this a long time ago. It's a script that sits between the user's input and an interactive program, and allows the input to be intercepted. I used it to escape to the shell to check filenames when running old Fortran programs that asked lots of questions. You could easily modify it to intercept particular inputs and sanitize them.
#!/usr/bin/perl
# shwrap.pl - Wrap any process for convenient escape to the shell.
use strict;
use warnings;
# Provide the executable to wrap as an argument
my $executable = shift;
my @escape_chars = ('#'); # Escape to shell with these chars
my $exit = 'bye'; # Exit string for quick termination
open my $exe_fh, "|$executable @ARGV" or die "Cannot pipe to program $executable: $!";
# Set magic buffer autoflush on...
select((select($exe_fh), $| = 1)[0]);
# Accept input until the child process terminates or is terminated...
while ( 1 ) {
chomp(my $input = <STDIN>);
# End if we receive the special exit string...
if ( $input =~ m/$exit/ ) {
close $exe_fh;
print "$0: Terminated child process...\n";
exit;
}
foreach my $char ( @escape_chars ) {
# Escape to the shell if the input starts with an escape character...
if ( my ($command) = $input =~ m/^$char(.*)/ ) {
system $command;
}
# Otherwise pass the input on to the executable...
else {
print $exe_fh "$input\n";
}
}
}
A simple example test program you can try it out on:
#!/usr/bin/perl
while (<>) {
print "Got: $_";
}
| Filtering the keyboard input |
1,498,426,566,000 |
i'm running Ubuntu 16.04 LTS and want to use an apple keyboard (wired). No i'm facing some problems whith making my custom settings permanent. I'm using the 'English internationl, AltGr dead keys' layout.
The keyboard has some keys swapped and i set the settings manually in the
/sys/module/hid_apple/parameters/ folder. I set fnmode to 2 , iso_layout to 0 and swap_opt_cmd to 1. After this everything works like intended. But after rebooting the settings are back to the default. I have to reset everything manually after each reboot.
For now i wrote a little shell script which would do it but that's not the best way i think.
How can i make these settings persistent?
|
It appears that you can create /etc/modprobe.d/hid_apple.conf and add the entries you need fixing in there, such as,
options hid_apple fnmode=2
NB: This assumes the hid_apple module is already being loaded.
| Make Apple Keyboard Settings persistent in ../hid_apple/parameters/ |
1,498,426,566,000 |
I bought a new keyboard similar to an old one. The old one works, the new one not. The new keyboard has an unusual HID Descriptor and sends one extra data byte. Is there a Linux driver which support such keyboard (descriptor)?
Communication log via cat /sys/kernel/debug/usb/usbmon/3u, byte sequences only (press A, release A; press Shift, press A, release A, release Shift sequence):
Non-working 9-byte keyboard communication:
00000400 00000000 71
00000000 00000000 71
02000000 00000000 71
02000400 00000000 71
02000000 00000000 71
00000000 00000000 71
Working old keyboard communication:
00000400 00000000
00000000 00000000
02000000 00000000
02000400 00000000
02000000 00000000
00000000 00000000
Bonus: What is the extra byte? (I always saw 0x71 there.)
HID Descriptors of the new keyboard via cat /sys/kernel/debug/hid/<interface>/rdesc:
Interface 0003:17EF:609B.0089:
05 01 09 06 a1 01 05 07 19 e0 29 e7 15 00 25 01 75 01 95 08 81 02 75 08 95 01 81 01 05 08 19 01 29 03 75 01 95 03 91 02 95 01 75 05 91 01 15 00 26 ff 00 19 00 2a ff 00 05 07 75 08 95 06 81 00 05 01 0a 68 01 15 80 25 7f 95 01 75 08 81 02 c0
INPUT[INPUT]
Field(0)
Application(GenericDesktop.Keyboard)
Usage(8)
Keyboard.00e0
Keyboard.00e1
Keyboard.00e2
Keyboard.00e3
Keyboard.00e4
Keyboard.00e5
Keyboard.00e6
Keyboard.00e7
Logical Minimum(0)
Logical Maximum(1)
Report Size(1)
Report Count(8)
Report Offset(0)
Flags( Variable Absolute )
Field(1)
Application(GenericDesktop.Keyboard)
Usage(256)
LED.0000
LED.NumLock
LED.CapsLock
LED.ScrollLock
LED.Compose
LED.Kana
LED.0006
LED.0007
LED.0008
LED.0009
... LED sequence left out
LED.0049
LED.004a
LED.GenericIndicator
LED.004c
LED.004d
LED.004e
LED.004f
... LED sequence left out
LED.00fd
LED.00fe
LED.00ff
Logical Minimum(0)
Logical Maximum(255)
Report Size(8)
Report Count(6)
Report Offset(16)
Flags( Array Absolute )
Field(2)
Application(GenericDesktop.Keyboard)
Usage(1)
GenericDesktop.0168
Logical Minimum(-128)
Logical Maximum(127)
Report Size(8)
Report Count(1)
Report Offset(64)
Flags( Variable Absolute )
OUTPUT[OUTPUT]
Field(0)
Application(GenericDesktop.Keyboard)
Usage(3)
LED.NumLock
LED.CapsLock
LED.ScrollLock
Logical Minimum(0)
Logical Maximum(1)
Report Size(1)
Report Count(3)
Report Offset(0)
Flags( Variable Absolute )
Keyboard.00e0 ---> Key.LeftControl
Keyboard.00e1 ---> Key.LeftShift
Keyboard.00e2 ---> Key.LeftAlt
Keyboard.00e3 ---> Key.LeftMeta
Keyboard.00e4 ---> Key.RightCtrl
Keyboard.00e5 ---> Key.RightShift
Keyboard.00e6 ---> Key.RightAlt
Keyboard.00e7 ---> Key.RightMeta
LED.0000 ---> Sync.Report
LED.NumLock ---> LED.NumLock
LED.CapsLock ---> LED.CapsLock
LED.ScrollLock ---> LED.ScrollLock
LED.Compose ---> LED.Compose
LED.Kana ---> LED.Kana
LED.0006 ---> Sync.Report
LED.0007 ---> Sync.Report
LED.0008 ---> Sync.Report
LED.0009 ---> LED.Mute
LED.000a ---> Sync.Report
LED.000b ---> Sync.Report
... Sync.Report lines left out
LED.0017 ---> Sync.Report
LED.0018 ---> Sync.Report
LED.0019 ---> LED.?
LED.001a ---> Sync.Report
LED.001b ---> Sync.Report
... Sync.Report lines left out
LED.0025 ---> Sync.Report
LED.0026 ---> Sync.Report
LED.0027 ---> LED.Sleep
LED.0028 ---> Sync.Report
LED.0029 ---> Sync.Report
... Sync.Report lines left out
LED.0049 ---> Sync.Report
LED.004a ---> Sync.Report
LED.GenericIndicator ---> LED.Misc
LED.004c ---> LED.Suspend
LED.004d ---> LED.?
LED.004e ---> Sync.Report
LED.004f ---> Sync.Report
... Sync.Report lines left out
LED.00fe ---> Sync.Report
LED.00ff ---> Sync.Report
GenericDesktop.0168 ---> Absolute.Misc
LED.NumLock ---> LED.?
LED.CapsLock ---> LED.?
LED.ScrollLock ---> LED.?
Interface 0003:17EF:609B.008B:
05 0c 09 01 a1 01 85 01 19 00 2a 3c 02 15 00 26 3c 02 95 01 75 10 81 00 05 01 0a 68 01 15 80 25 7f 95 01 75 08 81 02 c0 05 01 09 80 a1 01 85 02 19 81 29 83 15 00 25 01 75 01 95 03 81 02 95 05 81 01 05 01 0a 68 01 15 80 25 7f 95 01 75 08 81 02 c0 06 01 ff 09 01 a1 01 85 05 95 07 75 08 15 00 26 ff 00 09 20 b1 03 c0
INPUT(1)[INPUT]
Field(0)
Application(Consumer.0001)
Usage(573)
Consumer.0000
Consumer.0001
Consumer.0002
Consumer.0003
Consumer.0004
... Consumer sequence left out
Consumer.0235
Consumer.0236
Consumer.0237
Consumer.HorizontalWheel
Consumer.0239
Consumer.023a
Consumer.023b
Consumer.023c
Logical Minimum(0)
Logical Maximum(572)
Report Size(16)
Report Count(1)
Report Offset(0)
Flags( Array Absolute )
Field(1)
Application(Consumer.0001)
Usage(1)
GenericDesktop.0168
Logical Minimum(-128)
Logical Maximum(127)
Report Size(8)
Report Count(1)
Report Offset(16)
Flags( Variable Absolute )
INPUT(2)[INPUT]
Field(0)
Application(GenericDesktop.SystemControl)
Usage(3)
GenericDesktop.SystemPowerDown
GenericDesktop.SystemSleep
GenericDesktop.SystemWakeUp
Logical Minimum(0)
Logical Maximum(1)
Report Size(1)
Report Count(3)
Report Offset(0)
Flags( Variable Absolute )
Field(1)
Application(GenericDesktop.SystemControl)
Usage(1)
GenericDesktop.0168
Logical Minimum(-128)
Logical Maximum(127)
Report Size(8)
Report Count(1)
Report Offset(8)
Flags( Variable Absolute )
FEATURE(5)[FEATURE]
Field(0)
Application(ff01.0001)
Usage(7)
ff01.0020
ff01.0020
ff01.0020
ff01.0020
ff01.0020
ff01.0020
ff01.0020
Logical Minimum(0)
Logical Maximum(255)
Report Size(8)
Report Count(7)
Report Offset(0)
Flags( Constant Variable Absolute )
Consumer.0000 ---> Sync.Report
Consumer.0001 ---> Key.Unknown
Consumer.0002 ---> Key.Unknown
... Key.Unknown lines left out
Consumer.002e ---> Key.Unknown
Consumer.002f ---> Key.Unknown
Consumer.0030 ---> Key.Power
Consumer.0031 ---> Key.Restart
Consumer.0032 ---> Key.Sleep
Consumer.0033 ---> Key.Unknown
Consumer.0034 ---> Key.Sleep
Consumer.0035 ---> Key.KbdIlluminationToggle
Consumer.0036 ---> Key.Btn0
Consumer.0037 ---> Key.Unknown
Consumer.0038 ---> Key.Unknown
... Key.Unknown lines left out
Consumer.003e ---> Key.Unknown
Consumer.003f ---> Key.Unknown
Consumer.0040 ---> Key.Menu
Consumer.0041 ---> Key.Select
Consumer.0042 ---> Key.Up
Consumer.0043 ---> Key.Down
Consumer.0044 ---> Key.Left
Consumer.0045 ---> Key.Right
Consumer.0046 ---> Key.Esc
Consumer.0047 ---> Key.KPPlus
Consumer.0048 ---> Key.KPMinus
Consumer.0049 ---> Key.Unknown
Consumer.004a ---> Key.Unknown
... Key.Unknown lines left out
Consumer.005e ---> Key.Unknown
Consumer.005f ---> Key.Unknown
Consumer.0060 ---> Key.Info
Consumer.0061 ---> Key.Subtitle
Consumer.0062 ---> Key.Unknown
Consumer.0063 ---> Key.VCR
Consumer.0064 ---> Key.Unknown
Consumer.0065 ---> Key.Camera
Consumer.0066 ---> Key.Unknown
Consumer.0067 ---> Key.Unknown
Consumer.0068 ---> Key.Unknown
Consumer.0069 ---> Key.Red
Consumer.006a ---> Key.Green
Consumer.006b ---> Key.Blue
Consumer.006c ---> Key.Yellow
Consumer.006d ---> Key.Zoom
Consumer.006e ---> Key.Unknown
Consumer.006f ---> Key.BrightnessUp
Consumer.0070 ---> Key.BrightnessDown
Consumer.0071 ---> Key.Unknown
Consumer.0072 ---> Key.?
Consumer.0073 ---> Key.BrightnessMin
Consumer.0074 ---> Key.BrightnessMax
Consumer.0075 ---> Key.BrightnessAuto
Consumer.0076 ---> Key.Unknown
Consumer.0077 ---> Key.Unknown
... Key.Unknown lines left out
Consumer.0080 ---> Key.Unknown
Consumer.0081 ---> Key.Unknown
Consumer.0082 ---> Key.?
Consumer.0083 ---> Key.Last
Consumer.0084 ---> Key.Enter
Consumer.0085 ---> Key.Unknown
Consumer.0086 ---> Key.Unknown
Consumer.0087 ---> Key.Unknown
Consumer.0088 ---> Key.PC
Consumer.0089 ---> Key.TV
Consumer.008a ---> Key.WWW
Consumer.008b ---> Key.DVD
Consumer.008c ---> Key.Phone
Consumer.008d ---> Key.Program
Consumer.008e ---> Key.?
Consumer.008f ---> Key.?
Consumer.0090 ---> Key.Memo
Consumer.0091 ---> Key.CD
Consumer.0092 ---> Key.VCR
Consumer.0093 ---> Key.Tuner
Consumer.0094 ---> Key.Exit
Consumer.0095 ---> Key.Help
Consumer.0096 ---> Key.Tape
Consumer.0097 ---> Key.TV2
Consumer.0098 ---> Key.Sat
Consumer.0099 ---> Key.Unknown
Consumer.009a ---> Key.PVR
Consumer.009b ---> Key.Unknown
Consumer.009c ---> Key.ChannelUp
Consumer.009d ---> Key.ChannelDown
Consumer.009e ---> Key.Unknown
Consumer.009f ---> Key.Unknown
Consumer.00a0 ---> Key.VCR2
Consumer.00a1 ---> Key.Unknown
Consumer.00a2 ---> Key.Unknown
... Key.Unknown lines left out
Consumer.00ae ---> Key.Unknown
Consumer.00af ---> Key.Unknown
Consumer.00b0 ---> Key.Play
Consumer.00b1 ---> Key.Pause
Consumer.00b2 ---> Key.Record
Consumer.00b3 ---> Key.FastForward
Consumer.00b4 ---> Key.Rewind
Consumer.00b5 ---> Key.NextSong
Consumer.00b6 ---> Key.PreviousSong
Consumer.00b7 ---> Key.StopCD
Consumer.00b8 ---> Key.EjectCD
Consumer.00b9 ---> Key.Shuffle
Consumer.00ba ---> Key.Unknown
Consumer.00bb ---> Key.Unknown
Consumer.00bc ---> Key.?
Consumer.00bd ---> Key.Unknown
Consumer.00be ---> Key.Unknown
Consumer.00bf ---> Key.Slow
Consumer.00c0 ---> Key.Unknown
Consumer.00c1 ---> Key.Unknown
... Key.Unknown lines left out
Consumer.00cb ---> Key.Unknown
Consumer.00cc ---> Key.Unknown
Consumer.00cd ---> Key.PlayPause
Consumer.00ce ---> Key.Unknown
Consumer.00cf ---> Key.VoiceCommand
Consumer.00d0 ---> Key.Unknown
Consumer.00d1 ---> Key.Unknown
... Key.Unknown lines left out
Consumer.00de ---> Key.Unknown
Consumer.00df ---> Key.Unknown
Consumer.00e0 ---> Absolute.Volume
Consumer.00e1 ---> Key.Unknown
Consumer.00e2 ---> Key.Mute
Consumer.00e3 ---> Key.Unknown
Consumer.00e4 ---> Key.Unknown
Consumer.00e5 ---> Key.BassBoost
Consumer.00e6 ---> Key.Unknown
Consumer.00e7 ---> Key.Unknown
Consumer.00e8 ---> Key.Unknown
Consumer.00e9 ---> Key.VolumeUp
Consumer.00ea ---> Key.VolumeDown
Consumer.00eb ---> Key.Unknown
Consumer.00ec ---> Key.Unknown
... Key.Unknown lines left out
Consumer.00f3 ---> Key.Unknown
Consumer.00f4 ---> Key.Unknown
Consumer.00f5 ---> Key.Slow
Consumer.00f6 ---> Key.Unknown
Consumer.00f7 ---> Key.Unknown
... Key.Unknown lines left out
Consumer.017f ---> Key.Unknown
Consumer.0180 ---> Key.Unknown
Consumer.0181 ---> Key.ButtonConfig
Consumer.0182 ---> Key.Bookmarks
Consumer.0183 ---> Key.Config
Consumer.0184 ---> Key.?
Consumer.0185 ---> Key.?
Consumer.0186 ---> Key.?
Consumer.0187 ---> Key.?
Consumer.0188 ---> Key.?
Consumer.0189 ---> Key.?
Consumer.018a ---> Key.Mail
Consumer.018b ---> Key.?
Consumer.018c ---> Key.?
Consumer.018d ---> Key.?
Consumer.018e ---> Key.Calendar
Consumer.018f ---> Key.TaskManager
Consumer.0190 ---> Key.Journal
Consumer.0191 ---> Key.Finance
Consumer.0192 ---> Key.Calc
Consumer.0193 ---> Key.Player
Consumer.0194 ---> Key.File
Consumer.0195 ---> Key.Unknown
Consumer.0196 ---> Key.WWW
Consumer.0197 ---> Key.Unknown
Consumer.0198 ---> Key.Unknown
Consumer.0199 ---> Key.Chat
Consumer.019a ---> Key.Unknown
Consumer.019b ---> Key.Unknown
Consumer.019c ---> Key.Logoff
Consumer.019d ---> Key.Unknown
Consumer.019e ---> Key.Coffee
Consumer.019f ---> Key.ControlPanel
Consumer.01a0 ---> Key.Unknown
Consumer.01a1 ---> Key.Unknown
Consumer.01a2 ---> Key.AppSelect
Consumer.01a3 ---> Key.Next
Consumer.01a4 ---> Key.Previous
Consumer.01a5 ---> Key.Unknown
Consumer.01a6 ---> Key.Help
Consumer.01a7 ---> Key.Documents
Consumer.01a8 ---> Key.Unknown
Consumer.01a9 ---> Key.Unknown
Consumer.01aa ---> Key.Unknown
Consumer.01ab ---> Key.SpellCheck
Consumer.01ac ---> Key.Unknown
Consumer.01ad ---> Key.Unknown
Consumer.01ae ---> Key.Keyboard
Consumer.01af ---> Key.Unknown
Consumer.01b0 ---> Key.Unknown
Consumer.01b1 ---> Key.ScreenSaver
Consumer.01b2 ---> Key.Unknown
Consumer.01b3 ---> Key.Unknown
Consumer.01b4 ---> Key.File
Consumer.01b5 ---> Key.Unknown
Consumer.01b6 ---> Key.?
Consumer.01b7 ---> Key.Audio
Consumer.01b8 ---> Key.Video
Consumer.01b9 ---> Key.Unknown
Consumer.01ba ---> Key.Unknown
Consumer.01bb ---> Key.Unknown
Consumer.01bc ---> Key.?
Consumer.01bd ---> Key.Info
Consumer.01be ---> Key.Unknown
Consumer.01bf ---> Key.Unknown
... Key.Unknown lines left out
Consumer.01ff ---> Key.Unknown
Consumer.0200 ---> Key.Unknown
Consumer.0201 ---> Key.New
Consumer.0202 ---> Key.Open
Consumer.0203 ---> Key.Close
Consumer.0204 ---> Key.Exit
Consumer.0205 ---> Key.Unknown
Consumer.0206 ---> Key.Unknown
Consumer.0207 ---> Key.Save
Consumer.0208 ---> Key.Print
Consumer.0209 ---> Key.Props
Consumer.020a ---> Key.Unknown
Consumer.020b ---> Key.Unknown
... Key.Unknown lines left out
Consumer.0218 ---> Key.Unknown
Consumer.0219 ---> Key.Unknown
Consumer.021a ---> Key.Undo
Consumer.021b ---> Key.Copy
Consumer.021c ---> Key.Cut
Consumer.021d ---> Key.Paste
Consumer.021e ---> Key.Unknown
Consumer.021f ---> Key.Find
Consumer.0220 ---> Key.Unknown
Consumer.0221 ---> Key.Search
Consumer.0222 ---> Key.Goto
Consumer.0223 ---> Key.HomePage
Consumer.0224 ---> Key.Back
Consumer.0225 ---> Key.Forward
Consumer.0226 ---> Key.Stop
Consumer.0227 ---> Key.Refresh
Consumer.0228 ---> Key.Unknown
Consumer.0229 ---> Key.Unknown
Consumer.022a ---> Key.Bookmarks
Consumer.022b ---> Key.Unknown
Consumer.022c ---> Key.Unknown
Consumer.022d ---> Key.?
Consumer.022e ---> Key.?
Consumer.022f ---> Key.?
Consumer.0230 ---> Key.Unknown
Consumer.0231 ---> Key.Unknown
Consumer.0232 ---> Key.Unknown
Consumer.0233 ---> Key.ScrollUp
Consumer.0234 ---> Key.ScrollDown
Consumer.0235 ---> Key.Unknown
Consumer.0236 ---> Key.Unknown
Consumer.0237 ---> Key.Unknown
Consumer.HorizontalWheel ---> Relative.HWheel
Consumer.0239 ---> Key.Unknown
Consumer.023a ---> Key.Unknown
Consumer.023b ---> Key.Unknown
Consumer.023c ---> Key.Unknown
GenericDesktop.0168 ---> Absolute.Misc
GenericDesktop.SystemPowerDown ---> Key.Power
GenericDesktop.SystemSleep ---> Key.Sleep
GenericDesktop.SystemWakeUp ---> Key.WakeUp
GenericDesktop.0168 ---> Sync.Report
HID Descriptor of the old keyboard, interface 0003:17EF:6022.0087 (only one keyboard interface):
05 01 09 06 a1 01 05 07 19 e0 29 e7 15 00 25 01 75 01 95 08 81 02 95 01 75 08 81 01 15 00 26 a4 00 19 00 2a a4 00 05 07 75 08 95 06 81 00 c0
INPUT[INPUT]
Field(0)
Application(GenericDesktop.Keyboard)
Usage(8)
Keyboard.00e0
Keyboard.00e1
Keyboard.00e2
Keyboard.00e3
Keyboard.00e4
Keyboard.00e5
Keyboard.00e6
Keyboard.00e7
Logical Minimum(0)
Logical Maximum(1)
Report Size(1)
Report Count(8)
Report Offset(0)
Flags( Variable Absolute )
Field(1)
Application(GenericDesktop.Keyboard)
Usage(165)
Keyboard.0000
Keyboard.0001
Keyboard.0002
Keyboard.0003
Keyboard.0004
... Keyboard sequence left out
Keyboard.009f
Keyboard.00a0
Keyboard.00a1
Keyboard.00a2
Keyboard.00a3
Keyboard.00a4
Logical Minimum(0)
Logical Maximum(164)
Report Size(8)
Report Count(6)
Report Offset(16)
Flags( Array Absolute )
Keyboard.00e0 ---> Key.LeftControl
Keyboard.00e1 ---> Key.LeftShift
Keyboard.00e2 ---> Key.LeftAlt
Keyboard.00e3 ---> Key.LeftMeta
Keyboard.00e4 ---> Key.RightCtrl
Keyboard.00e5 ---> Key.RightShift
Keyboard.00e6 ---> Key.RightAlt
Keyboard.00e7 ---> Key.RightMeta
Keyboard.0000 ---> Sync.Report
Keyboard.0001 ---> Sync.Report
Keyboard.0002 ---> Sync.Report
Keyboard.0003 ---> Sync.Report
Keyboard.0004 ---> Key.A
Keyboard.0005 ---> Key.B
Keyboard.0006 ---> Key.C
Keyboard.0007 ---> Key.D
Keyboard.0008 ---> Key.E
Keyboard.0009 ---> Key.F
Keyboard.000a ---> Key.G
Keyboard.000b ---> Key.H
Keyboard.000c ---> Key.I
Keyboard.000d ---> Key.J
Keyboard.000e ---> Key.K
Keyboard.000f ---> Key.L
Keyboard.0010 ---> Key.M
Keyboard.0011 ---> Key.N
Keyboard.0012 ---> Key.O
Keyboard.0013 ---> Key.P
Keyboard.0014 ---> Key.Q
Keyboard.0015 ---> Key.R
Keyboard.0016 ---> Key.S
Keyboard.0017 ---> Key.T
Keyboard.0018 ---> Key.U
Keyboard.0019 ---> Key.V
Keyboard.001a ---> Key.W
Keyboard.001b ---> Key.X
Keyboard.001c ---> Key.Y
Keyboard.001d ---> Key.Z
Keyboard.001e ---> Key.1
Keyboard.001f ---> Key.2
Keyboard.0020 ---> Key.3
Keyboard.0021 ---> Key.4
Keyboard.0022 ---> Key.5
Keyboard.0023 ---> Key.6
Keyboard.0024 ---> Key.7
Keyboard.0025 ---> Key.8
Keyboard.0026 ---> Key.9
Keyboard.0027 ---> Key.0
Keyboard.0028 ---> Key.Enter
Keyboard.0029 ---> Key.Esc
Keyboard.002a ---> Key.Backspace
Keyboard.002b ---> Key.Tab
Keyboard.002c ---> Key.Space
Keyboard.002d ---> Key.Minus
Keyboard.002e ---> Key.Equal
Keyboard.002f ---> Key.LeftBrace
Keyboard.0030 ---> Key.RightBrace
Keyboard.0031 ---> Key.BackSlash
Keyboard.0032 ---> Key.BackSlash
Keyboard.0033 ---> Key.Semicolon
Keyboard.0034 ---> Key.Apostrophe
Keyboard.0035 ---> Key.Grave
Keyboard.0036 ---> Key.Comma
Keyboard.0037 ---> Key.Dot
Keyboard.0038 ---> Key.Slash
Keyboard.0039 ---> Key.CapsLock
Keyboard.003a ---> Key.F1
Keyboard.003b ---> Key.F2
Keyboard.003c ---> Key.F3
Keyboard.003d ---> Key.F4
Keyboard.003e ---> Key.F5
Keyboard.003f ---> Key.F6
Keyboard.0040 ---> Key.F7
Keyboard.0041 ---> Key.F8
Keyboard.0042 ---> Key.F9
Keyboard.0043 ---> Key.F10
Keyboard.0044 ---> Key.F11
Keyboard.0045 ---> Key.F12
Keyboard.0046 ---> Key.SysRq
Keyboard.0047 ---> Key.ScrollLock
Keyboard.0048 ---> Key.Pause
Keyboard.0049 ---> Key.Insert
Keyboard.004a ---> Key.Home
Keyboard.004b ---> Key.PageUp
Keyboard.004c ---> Key.Delete
Keyboard.004d ---> Key.End
Keyboard.004e ---> Key.PageDown
Keyboard.004f ---> Key.Right
Keyboard.0050 ---> Key.Left
Keyboard.0051 ---> Key.Down
Keyboard.0052 ---> Key.Up
Keyboard.0053 ---> Key.NumLock
Keyboard.0054 ---> Key.KPSlash
Keyboard.0055 ---> Key.KPAsterisk
Keyboard.0056 ---> Key.KPMinus
Keyboard.0057 ---> Key.KPPlus
Keyboard.0058 ---> Key.KPEnter
Keyboard.0059 ---> Key.KP1
Keyboard.005a ---> Key.KP2
Keyboard.005b ---> Key.KP3
Keyboard.005c ---> Key.KP4
Keyboard.005d ---> Key.KP5
Keyboard.005e ---> Key.KP6
Keyboard.005f ---> Key.KP7
Keyboard.0060 ---> Key.KP8
Keyboard.0061 ---> Key.KP9
Keyboard.0062 ---> Key.KP0
Keyboard.0063 ---> Key.KPDot
Keyboard.0064 ---> Key.102nd
Keyboard.0065 ---> Key.Compose
Keyboard.0066 ---> Key.Power
Keyboard.0067 ---> Key.KPEqual
Keyboard.0068 ---> Key.F13
Keyboard.0069 ---> Key.F14
Keyboard.006a ---> Key.F15
Keyboard.006b ---> Key.F16
Keyboard.006c ---> Key.F17
Keyboard.006d ---> Key.F18
Keyboard.006e ---> Key.F19
Keyboard.006f ---> Key.F20
Keyboard.0070 ---> Key.F21
Keyboard.0071 ---> Key.F22
Keyboard.0072 ---> Key.F23
Keyboard.0073 ---> Key.F24
Keyboard.0074 ---> Key.Open
Keyboard.0075 ---> Key.Help
Keyboard.0076 ---> Key.Props
Keyboard.0077 ---> Key.Front
Keyboard.0078 ---> Key.Stop
Keyboard.0079 ---> Key.Again
Keyboard.007a ---> Key.Undo
Keyboard.007b ---> Key.Cut
Keyboard.007c ---> Key.Copy
Keyboard.007d ---> Key.Paste
Keyboard.007e ---> Key.Find
Keyboard.007f ---> Key.Mute
Keyboard.0080 ---> Key.VolumeUp
Keyboard.0081 ---> Key.VolumeDown
Keyboard.0082 ---> Key.Unknown
Keyboard.0083 ---> Key.Unknown
Keyboard.0084 ---> Key.Unknown
Keyboard.0085 ---> Key.KPComma
Keyboard.0086 ---> Key.Unknown
Keyboard.0087 ---> Key.RO
Keyboard.0088 ---> Key.Katakana/Hiragana
Keyboard.0089 ---> Key.Yen
Keyboard.008a ---> Key.Henkan
Keyboard.008b ---> Key.Muhenkan
Keyboard.008c ---> Key.KPJpComma
Keyboard.008d ---> Key.Unknown
Keyboard.008e ---> Key.Unknown
Keyboard.008f ---> Key.Unknown
Keyboard.0090 ---> Key.Hangeul
Keyboard.0091 ---> Key.Hanja
Keyboard.0092 ---> Key.Katakana
Keyboard.0093 ---> Key.HIRAGANA
Keyboard.0094 ---> Key.Zenkaku/Hankaku
Keyboard.0095 ---> Key.Unknown
Keyboard.0096 ---> Key.Unknown
... Key.Unknown lines left out
Keyboard.009a ---> Key.Unknown
Keyboard.009b ---> Key.Unknown
Keyboard.009c ---> Key.Delete
Keyboard.009d ---> Key.Unknown
Keyboard.009e ---> Key.Unknown
... Key.Unknown lines left out
Keyboard.00a3 ---> Key.Unknown
Keyboard.00a4 ---> Key.Unknown
(Issue experienced on Lenovo Professional Wireless Keyboard, an ASUS keyboard... both wireless keyboards manufactured by Primax.)
(Issue not experienced on Windows and GRUB.)
(Yves Trudeau has already played with it and implemented a driver which ignores the extra byte, but I would rather use something from vanilla kernel and something less hacky.)
|
A proper fix was merged into the Linux kernel: https://lkml.org/lkml/2019/3/27/350
It'll be available whenever version 5.2 comes out, and probably back-ported on some distributions.
| Linux HID driver for Primax wireless keyboards |
1,498,426,566,000 |
I plugged in a PS/2 mouse while inside my Gnome desktop, but Linux doesn't recognize it.
Linux will only recognize the PS/2 mouse if it is plugged in before booting the machine (like a normal scenario).
In this case, I forgot to plug in the mouse, plugged it in when I got to the desktop, but realized that it doesn't work.
How do I detect PS/2 devices (my mouse) in real time so I don't have to reboot just to use a mouse?
|
That's just the way that the PS/2 port works. Unlike the USB, the PS/2 was not designed to be hot-plugged. If you need the hot-plugging capability, use a USB mouse. Otherwise, there is no guarantee that any solution will work consistently.
| How do you force Linux to detect a PS/2 device (e.g. mouse) on demand? |
1,498,426,566,000 |
I use standard Danish QWERTY keyboard (on Debian, if the distro matters). Is it at all possible to write German umlauts such as Ä, Ö, Ü by some key combos (that is without changing the layout to German)?
|
The key between Å and Enter should produce a "dead diaeresis". I.e. pressing the ¨ key followed by u should produce ü.
I'm not Danish so I'm basing this on my knowledge of the Finnish/Swedish keyboard and Wikipedia.
| German umlaut on Danish keyboard |
1,498,426,566,000 |
Is it possible to use C-up and C-down when running emacs in the terminal window (when starting emacs from the command line with the -nw flag)? What should my terminal send when I press C-up and C-down for these keys to work in emacs?
I'm on Mac OSX, using iterm2 to ssh into a remote linux server, where I start the emacs session from bash.
|
Terminals know characters, not keys, so keys with no corresponding character need to be translated into escape sequences and back.
You can pick any control sequences that doesn't cause any conflict and that iterm2 and Emacs agree on. Unfortunately, these control sequences aren't standardized. \e[1;5A and \e[1;5B are popular choices (where \e is an escape character).
Emacs has a fairly complex system to translate escape sequences into keys. See translation keymaps in the manual. Use input-decode-map unless you have an old version of Emacs that doesn't have it.
(define-key input-decode-map "\e[1;5A" [C-up])
(define-key input-decode-map "\e[1;5B" [C-down])
In iterm2, set the corresponding key sequences in the “Keys” tab in your profile. See How can I get control+left arrow to go back one word in iTerm2? for an illustrated guide.
See also Emacs + paredit under terminal (Terminal.app, iTerm, iTerm2).
| Control and up/down keys in terminal for use by emacs |
1,498,426,566,000 |
I accidentally set my keyboard type to US during installation, but it actually is UK type. How do I change it?
[note] I use Debian Squeeze.
|
The Debian way is:
dpkg-reconfigure keyboard-configuration
dpkg-reconfigure console-data
To make the change visible in X (else reboot):
/etc/init.d/hal restart
| How to change keyboard keymap |
1,498,426,566,000 |
I use a Linux PC at work but a MacBook at home, and the constant switch between keyboard layouts is bothersome. I would love a way to "remap" the keys of my Ubuntu computer so that they would function in the same way as my MacBook and feel "natural" to my fingers.
Basically, I would like the Left Alt key to function as a Ctrl key, the Win key as an Option key, and the Ctrl key as an Alt key. I'd also like the Caps Lock to toggle language input settings if possible.
|
Well I played around with various command line tools but they're not particularly intuitive or friendly. Luckily I stumbled across a project on Github that works great and has a beautiful, simple GUI called "Key Mapper."
https://github.com/sezanzeb/key-mapper
It's available for various Linux distros. Here's an example of swapping the Alt key so that it now behaves as the MacOS "Command" key that would be in the same spot:
Very simple and intuitive.
| Mapping the Linux keyboard to match MacOS keys |
1,498,426,566,000 |
Status: This is fixed as of Kernel 4.18, see the accepted answer for details.
I just started using a Redragon Asura USB Keyboard. The keyboard works at a basic level, but unfortunately all the Ctrl, Alt keys and the Win key are mapped to the left shift key, which makes it quite hard to use.
The dmesg output is
[185765.848957] input: USB Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/0003:0C45:760B.0022/input/input50
[185765.905395] hid-generic 0003:0C45:760B.0022: input,hidraw3: USB HID v1.11 Keyboard [USB Keyboard] on usb-0000:00:14.0-3/input0
[185765.949342] input: USB Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.1/0003:0C45:760B.0023/input/input51
[185766.009474] hid-generic 0003:0C45:760B.0023: input,hiddev0,hidraw4: USB HID v1.11 Keyboard [USB Keyboard] on usb-0000:00:14.0-3/input1
I've started debugging the key presses using xev, and I get the exact same key mapping for those keys. I might've mixed the KeyPress and KeyRelease events, but all in all they are the same ( see at the end of the post ).
What can I do to properly map the Ctrl, Alt and Win keys?
Left alt:
KeyRelease event, serial 36, synthetic NO, window 0x3200001,
root 0xd7, subw 0x0, time 185237066, (307,429), root:(2272,538),
state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
Left ctrl:
KeyPress event, serial 36, synthetic NO, window 0x3200001,
root 0xd7, subw 0x0, time 185265721, (443,237), root:(2408,346),
state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
Left shift:
KeyRelease event, serial 36, synthetic NO, window 0x3200001,
root 0xd7, subw 0x0, time 185303441, (436,539), root:(2401,648),
state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
Win key:
KeyPress event, serial 36, synthetic NO, window 0x3200001,
root 0xd7, subw 0x0, time 185327465, (399,367), root:(2364,476),
state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
Right Alt:
KeyPress event, serial 36, synthetic NO, window 0x3200001,
root 0xd7, subw 0x0, time 185361768, (348,141), root:(2313,250),
state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
Right ctrl:
KeyPress event, serial 36, synthetic NO, window 0x3200001,
root 0xd7, subw 0x0, time 185401328, (598,415), root:(2563,524),
state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
Edit: indeed, the keyboard shows up as two USB devices. I've uploaded the HID descriptors from /sys/debug/kernel/hid at
https://pastebin.com/4VwDKRvU
https://pastebin.com/CrBVRFBj
|
My Linux kernel patch to fix Redragon Asura keyboards is now mainlined and will part of the Kernel 4.18 release.
There is a minor issue with the Num Lock and Caps Lock LEDs not being active ( keys work just fine ) that will be fixed with 4.19.
The patch can be applied to 4.16 and 4.17 as well, openSUSE started carrying it with 4.16.
| Redragon Asura USB keyboard maps all Ctrl, Alt, Win keys to Shift_L |
1,498,426,566,000 |
Note: I asked this question in superuser about a month ago, but there hasn't been a reply till then, and the question relates to linux, so I'm posting it here.
I want to swap esc and caps_lock keys on my keyboard. setxkbmap -option caps:swapescape gets the job done but only for X. The keys behave in original way on a virtual console. How can I make them behave in the required way on a vc?
|
Use loadkeys.
To swap Esc and Caps Lock in the console, run
printf 'keycode 1 = Caps_Lock Caps_Lock\nkeycode 58 = Escape Escape\n' | sudo loadkeys -
| swapping keys in a virtual terminal |
1,498,426,566,000 |
So, I've been studying the basics for my LPIC-1, and I have a question about /proc/interrupts
When consoled into a server, I can see key logging occurring (cat /proc/interrupts | grep i8042 count for 1: increases with each keystroke).
However, when I ssh into the box, no matter how many times I echo absurd amounts of text, the i8042 count never increases.
Are keystroked logged against /proc/interrupts when accessing servers via ssh?
|
The i8042 is the keyboard controller. The key counter will be only incremented by a real keyboard.
When you are entering via ssh, you are using a pseudo-tty and obviously not using the local (physical) keyboard. There are no IRQs there for the keys.
I will leave a link detailing this.
http://www.thegeekstuff.com/2014/01/linux-interrupts/
| Does SSH access trigger keyboard interrupts? |
1,498,426,566,000 |
How can I use Latin characters on Linux Mint? I've tried the alt key like on Windows but it doesn't work. I've searched and they say that alt doesn't work on Linux like on Windows.
I've tried other keys, but none seems to work.
|
You need to activate the compose key to use that. Go to the keyboard preferences, to the Layouts tab and click on the Options... button.
It will open a new pop up, there you'll have to search for the option Position of the Compose Key and there you have a list of keys that you can enable for that functionality like alt, ctrl, etc.
Edit
On Linux the shortcuts don't work like on Windows.
Imagine, if you want to type á you have to press alt + ' + a (assuming that alt is the compose key).
| Latin characters on Mint - Alt key like Windows |
1,498,426,566,000 |
In some applications entering capital letters works like hitting ESC key.
Reproducing:
Open LibreOffice document
Select "Save as" (Unity dialog)
Hit "Create folder"
Enter a capital letter using shift key (e.g. Shift+A)
As this point the creating of the new folder get canceled. (like ESC key was hit)
This behavior is also present in many different programs and games.
Analyzing the situation with xev (Hitting Shift+d)
# xev
KeyPress event, serial 37, synthetic NO, window 0x4c00001,
root 0x259, subw 0x0, time 994702, (15,-13), root:(987,197),
state 0x10, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
FocusOut event, serial 37, synthetic NO, window 0x4c00001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 37, synthetic NO, window 0x4c00001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 37, synthetic NO, window 0x0,
keys: 89 0 0 0 0 1 4 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
KeyPress event, serial 37, synthetic NO, window 0x4c00001,
root 0x259, subw 0x0, time 994927, (15,-13), root:(987,197),
state 0x11, keycode 40 (keysym 0x44, D), same_screen YES,
XLookupString gives 1 bytes: (44) "D"
XmbLookupString gives 1 bytes: (44) "D"
XFilterEvent returns: False
KeyRelease event, serial 37, synthetic NO, window 0x4c00001,
root 0x259, subw 0x0, time 995062, (15,-13), root:(987,197),
state 0x11, keycode 40 (keysym 0x44, D), same_screen YES,
XLookupString gives 1 bytes: (44) "D"
XFilterEvent returns: False
KeyRelease event, serial 37, synthetic NO, window 0x4c00001,
root 0x259, subw 0x0, time 995395, (15,-13), root:(987,197),
state 0x11, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
I think, that the FocusOut and FocusIn events look suspicious.
Linux: Ubuntu 14.04 LTS 32bit, Unity
How can I fix my system? Any ideas or further tests are welcome!
Edit: The solution
I used to configure language switch to LeftShift+RightShift. This worked for years, but become the problem at some point. Anyway configuring switch to any other key combination solved the problem.
|
FocusOut event, serial 37, synthetic NO, window 0x4c00001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 37, synthetic NO, window 0x4c00001,
mode NotifyUngrab, detail NotifyAncestor
What happened when you pressed A with Shift held is a passive grab: there's an X client which has exclusive control over this key combination, and when the key combination is pressed, the event is routed only to that client, not to xev or anyone else. xev does report the client grabbing the key combination when it happens and ungrabbing it when it's over.
In layman's terms, there's a program that's defined Shift+A as a global keybinding. It's probably a typo where you meant to bind Shift+Alt+key or Win+Shift+A something.
In Manipulating X key and pointer grabs on the command line I asked how to find who the grabber is. The best way I found only reports active grab, so the key has to be down when the information is queried.
Install xdotool if you don't already have it.
Run sleep 1; xdotool key XF86LogGrabInfo.
Within one second, press and hold Shift+A. Hold until xdotool has run.
Look in the X server log for information about the grab. The typical location of the X server log is /var/log/Xorg.0.log (the 0 reflects the display number, i.e. the number in $DISPLAY: if $DISPLAY is :1 or :1.0 then look at /var/log/Xorg.1.log, etc.).
Here's some sample output showing that the key I pressed was a key binding defined by sawfish:
[2292688.331] Active grab 0x41602244 (core) on device 'Virtual core keyboard' (3):
[2292688.331] client pid 6745 sawfish
[2292688.331] at 2292687547 (from passive grab) (device thawed, state 3)
[2292688.331] core event mask 0x3
[2292688.331] passive grab type 2, detail 0x4e, activating key 78
[2292688.331] owner-events false, kb 0 ptr 0, confine 0, cursor 0x0
[2292688.331] (II) End list of active device grabs
| Can't enter capital letters using shift key |
1,498,426,566,000 |
As far as I know these keys could be found on some keyboards that are extinct nowadays. I have to confess to have never seen any other keyboards in real life (save computer museums here) but standard 104/105 ones (as well as localised flavours of it) and Mac keyboards.
I am sure enthusiasts have fancy keyboards with lots of extra keys (possibly, including the keys in question) and it is probably true that computers that are neither PC, nor Mac come with their own keyboards. That being said, all these keyboards can hardly be called mainstream.
All right, Super has a direct equivalent in what they call the Windows key in MS world, but the other two seem to belong to the time long past. I remember seeing instructions with phrases like «Meta is Alt» and in some cases it has been «Meta is the same as Super». Hyper is even more enigmatic beast not unlike Unicorn.
Why are people in *nix world still sticking with these obsolete key names as though they corresponded to real keys? What is wrong with real Ctrl-Alt-Shift-Win(Super) from the perspective of the *nix community? I would like to know if there are any reasons to use these names except for historical ones.
|
The main reason the names persist is probably that they are preserved in the X11 protocol definitions:
#define XK_Meta_L 0xffe7 /* Left meta */
#define XK_Meta_R 0xffe8 /* Right meta */
#define XK_Alt_L 0xffe9 /* Left alt */
#define XK_Alt_R 0xffea /* Right alt */
#define XK_Super_L 0xffeb /* Left super */
#define XK_Super_R 0xffec /* Right super */
#define XK_Hyper_L 0xffed /* Left hyper */
#define XK_Hyper_R 0xffee /* Right hyper */
Because X has few modifiers (beyond the above, only Ctrl, Shift, Caps Lock), these modifiers remain useful, and their names along with them. Mod, Meta, Super ... keys? has more details.
Referring to the key between Ctrl and Alt as Super also avoids references to any particular logo, which can be considered an advantage. The names’ genericity, i.e. the fact that they don’t have a de facto meaning, combined with X’s ability to re-assign keys in whatever way the user desires, can arguably be both an advantage and a disadvantage (witness the confusion around Meta).
See also What do the keys on this Symbolics Space Cadet keyboard do? and What are the meta, super, and hyper keys? for the historical background.
I suspect the names will survive the transition to Wayland (assuming it ever completes), which would make this answer invalid of course.
| Why are names for Super, Meta and Hyper keys still in use? |
1,498,426,566,000 |
Updated my packages today on my Lenovo Thinkpad X1 Carbon (6th Gen). I didn't expect anything to happen but it did. The Mute indicator LED's on the F1 and F4 key stopped working.
I actually know this will be fixed soon. I'm just making a question so that I can answer it, in case anyone else is looking for a solution.
|
Situation
A Lenovo Thinkpad X1 Carbon running Arch Linux updated its packages on December 15th since October 22nd. After a reboot the LED indicators of the Mute Mic and Mute Speakers keys stopped working.
Investigation
I started my investigation by simply searching for phrases like "Mute LED not working" but couldn't find anything recent. I knew it had to be recent since the symptoms emerged exactly after an update.
Other buttons worked fine, Caps Lock, Fn Lock, but only the Mute buttons didn't work.
Finding the responsible package
In /var/log/pacman.log/ I checked the packages that were updated. It were a whole lot, but nothing that could interfere with my Thinkpad buttons, except for an update to PulseAudio, ALSA, and the Linux Kernel.
I decided I would check the kernel first. To downgrade the kernel to the previous version I executed
~ # pacman -U /var/cache/pacman/linux-4.18.16.arch1-1-x86_64.pkg.tar.xz
After rebooting the lights worked again. I now knew for certain that the problem came from within an update to the Linux kernel.
Finding the responsible kernel version
I now know Kernel 4.18.16 is working, and I know 4.19.8 is not!
From the Arch Linux Package Archive (https://archive.archlinux.org/) I downloaded version 4.19 through 4.19.8, knowing the kernel broke somewhere in between.
Because I was on 4.18.16, I upgraded to 4.19.4. 19.4 worked like 18.16 did, so the bug was introduced after 19.4 but before 19.8
Next up was 19.6. This version also works fine, so I now know the bug was introduced in 19.7. After upgrading once more, sure enough, 4.19.7 was the first release where this "regression" (as they call it), took place.
Finding the commit responsible
Thanks to linux being open source, you can look up the changelog of every linux release on https://kernel.org
Here is the changelog for version 4.19.7: https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.9
Warning, it is very big! To find some indication of where the problem has begun, I decided to CTRL+F some keywords into the file. First I tried "led", but there were no commits that looked promising. Then I searched for "mute", but again, no hits.
After a few other keywords I tried "carbon", and I found a commit named:
dcd51305cd41e77bf775992e6d6cee52f83426b7
ALSA: hda/realtek - fix the pop noise on headphone for lenovo laptops
My first thought was "Oh great, they fixed that!", but since this was also the only commit mentioning Lenovo, and this was the changelog of the regressed kernel, my best bet was to investigate.
Thankfully this commit included a BugLink to launchpad.net: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1805079
I thought that there I could ask the developer if they too had a problem with their LED lights. But I didn't even need to ask, since another user already described the problem I was having: (Link)
I'm on Lenovo ThinkPad X1 Carbon 6th, model 20KH006JGE.
After upgrading to Linux 4.19.7, the audio mute and
microphone mute LEDs (on F1 and F4 keys) stopped working.
The creator of the commit had already responded, and had even provided a solution! Great stuff, but now what? I don't want to compile my own kernel... Yuck! I need to know when this fix will be implemented.
Finding the repairing commit
Luckily the whole linux kernel is on GitHub! https://github.com/torvalds/linux
I dove into the commit history, and CTRL+F'd for "LED", and sure enough, on page 4 I found the fixing commit! (link)
6ba189c5c1a4bda70dc1e4826c58b0246068bb8d
ALSA: hda/realtek - Fix the mute LED regresion on Lenovo X1 Carbon
Awesome, it seems like this commit is already posted and reviewed, so where is it now? When is the fix going to be released?
Finding out when the fix will be released
So linux' releases are maintained by Greg Kroah-Hartman. You might have seen his name on top of the changelog we looked at earlier. Every few days he gathers usefull commits from the repository and bundles them into a new stable.
You can track the progress and discussion of the release cycle in the mailing list stable from kernel.org. If you don't want to subscribe, but just read, you can find an archive right here: https://www.spinics.net/lists/stable/
There I simply pulled out my trusty CTRL+F once again and searched for "LED", and hell yeah, sure enough: [PATCH 4.19 140/142] was the commit I was looking for.
Greg has included the commit we wanted and is currently reviewing it's release. It is only a couple of days before I closes discussion, followed by release of 4.19.10.
Finally: The solution
To fix the issue, please downgrade the kernel to at most version 4.19.6.
You can also wait a couple of days, since version 4.19.10 will fix the regression, and it is expected to be released on December 16th or 17th.
I hope my journey was mildly interesting to read, and can help you troubleshoot your issues in the future. I learned about changelogs, commits, repo's, releases, mailing lists and a whole lot more, so I just had to share.
Kind regards and have fun!
| Lenovo Thinkpad Mute LED Stopped working after update |
1,536,681,940,000 |
I accidentally deleted the xorg.conf.d folder. Now my mouse, keyboard, touchpad aren't working, and I am stuck on login screen.
Also booting with older kernels doesn't work. However, the keyboard works in bios and grub. I don't have a backup, and there is too much to lose.
Grub and dpkg did not help.
|
I was not able to connect to wi-fi or any other Internet connection. So i plugged in my bootable thub drive and used it's file manager to locate files on a bootable usb, then i just copied and pasted them into /usr/share/X11/xorg.conf.dto my hd (which was shown as external drive ) and everything was working fine after. (You should open your hd as root in order to be able to paste files there) This solution worked for me. hope no one repeats my mistakes.
| Keyboard and mouse doesn't work after accidental deletion of xorg.conf.d |
1,536,681,940,000 |
I'm having trouble using my Apple Magic Keyboard (bluetooth wireless with LiIon battery, Lightning port for charging and tethered usage) with Fedora 25 (kernel: 4.8.15-300.fc25.x86_64).
The problem is that when used in wireless mode, the Fn key does not seem to register. I tried xev and the key itself doesn't trigger any event, nor does the key pressed with another key cause the triggered event to be any different compared to the other key just being pressed on its own. The reason why I'd like to use the Fn key is because I want to map Fn + ←/→ to Home and End respectively and also use the multimedia keys which are now function keys by default.
The interesting thing is that this keyboard acts as a normal Apple wired keyboard when I connect it with the lightning cable to the computer in which I assume is due to the bluetooth radio not being used and resorting to USB hardware/drivers (perhaps it's registered with a different USB device ID than the original Apple aluminium keyboard, I didn't verify). Doing so allows function key usage and all the tricks like function keys or multimedia keys by default that you find on the internet.
However, I would like to have the same features available when using it as a bluetooth keyboard. I would go as far as patching the kernel, but have no idea where to start and how to test and debug (obviously I would like to try out less "invasive" means first).
Any idea on how to address this problem are welcome.
Update
When I read from /dev/hidraw0, I get some activity when hitting the Fn key, so this could mean the fn keypress is registered by the system, but gets lost somewhere along the way...
Update2
evtest does not show any event when pressing the Fn key and /dev/input/event4 (which is the event device for the Magic Keyboard) does not trigger an event (other keys do). So I think the problem is that the Fn key gets read by the system (implied by /dev/hidraw0 showing data) but it doesn't get passed on to /dev/input/event4. But this is just speculation as I don't know how the flow of user input data is meant to be working in Linux.
Update 3
This is what several fn key presses (press+release) produce:
> sudo cat /dev/hidraw2 | hexdump
0000000 0001 0000 0000 0000 0000 0001 0000 0000
0000010 0000 0200 0001 0000 0000 0000 0000 0001
0000020 0000 0000 0000 0200 0001 0000 0000 0000
0000030 0000 0001 0000 0000 0000 0200 0001 0000
0000040 0000 0000 0000 0001 0000 0000 0000 0200
0000050 0001 0000 0000 0000 0000 0001 0000 0000
0000060 0000 0200 0001 0000 0000 0000 0000 0001
0000070 0000 0000 0000 0200 0001 0000 0000 0000
0000080 0000 0001 0000 0000 0000 0200 0001 0000
0000090 0000 0000 0000 0001 0000 0000 0000 0200
00000a0 0001 0000 0000 0000 0000 0001 0000 0000
00000b0 0000 0200 0001 0000 0000 0000 0000 0001
00000c0 0000 0000 0000 0200 0001 0000 0000 0000
00000d0 0000 0001 0000 0000 0000 0200 0001 0000
00000e0 0000 0000 0000 0001 0000 0000 0000 0200
00000f0 0001 0000 0000 0000 0000 0001 0000 0000
0000100 0000 0200 0001 0000 0000 0000 0000 0001
0000110 0000 0000 0000 0200 0001 0000 0000 0000
0000120 0000 0001 0000 0000 0000 0200 0001 0000
0000130 0000 0000 0000 0001 0000 0000 0000 0200
0000140 0001 0000 0000 0000 0000 0001 0000 0000
0000150 0000 0200 0001 0000 0000 0000 0000 0001
0000160 0000 0000 0000 0200 0001 0000 0000 0000
0000170 0000 0001 0000 0000 0000 0200 0001 0000
0000180 0000 0000 0000 0001 0000 0000 0000 0200
0000190 0001 0000 0000 0000 0000 0001 0000 0000
00001a0 0000 0200 0001 0000 0000 0000 0000 0001
00001b0 0000 0000 0000 0200 0001 0000 0000 0000
00001c0 0000 0001 0000 0000 0000 0200 0001 0000
00001d0 0000 0000 0000 0001 0000 0000 0000 0200
00001e0 0001 0000 0000 0000 0000 0001 0000 0000
00001f0 0000 0200 0001 0000 0000 0000 0000 0001
0000200 0000 0000 0000 0200 0001 0000 0000 0000
0000210 0000 0001 0000 0000 0000 0200 0001 0000
0000220 0000 0000 0000 0001 0000 0000 0000 0200
0000230 0001 0000 0000 0000 0000 0001 0000 0000
Weirdly enough, sometimes 2 lines but mostly 1 line is printed after releasing fn.
This is what F2 and Fn+F2 respectively look like:
sudo cat /dev/hidraw2 | hexdump
0000000 0001 0000 0000 0000 0000 0001 3b00 0000
^[OQ0000010 0000 0000 0001 0000 0000 0000 0000 0001
^[OQ0000020 3b00 0000 0000 0000 0001 0000 0000 0000
^[OQ0000030 0000 0001 3b00 0000 0000 0000 0001 0000
0000040 0000 0000 0000 0001 3b00 0000 0000 0000
^[OQ0000050 0001 0000 0000 0000 0000 0001 3b00 0000
^[OQ0000060 0000 0000 0001 0000 0000 0000 0000 0001
^[OQ0000070 3b00 0000 0000 0000 0001 0000 0000 0000
0000080 0000 0101 0000 0000 0000 0000 0101 0600
^C
Fn+F2:
> sudo cat /dev/hidraw2 | hexdump
0000000 0001 0000 0000 0000 0000 0001 0000 0000
^[OQ0000010 0000 0200 0001 3b00 0000 0000 0200 0001
0000020 0000 0000 0000 0200 0001 3b00 0000 0000
^[OQ0000030 0200 0001 0000 0000 0000 0200 0001 3b00
^[OQ0000040 0000 0000 0200 0001 0000 0000 0000 0200
^[OQ0000050 0001 3b00 0000 0000 0200 0001 0000 0000
^[OQ0000060 0000 0200 0001 3b00 0000 0000 0200 0001
0000070 0000 0000 0000 0200 0001 3b00 0000 0000
^[OQ0000080 0200 0001 0000 0000 0000 0200 0001 3b00
^[OQ0000090 0000 0000 0200 0001 0000 0000 0000 0200
^[OQ00000a0 0001 3b00 0000 0000 0200 0001 0000 0000
00000b0 0000 0200 0001 0000 0000 0000 0000 0101
00000c0 0000 0000 0000 0000 0101 0600 0000 0000
^C
Update 4
As requested from @dirkt, here's the report descriptor information (I couldn't run the line as per the comment, so here's the full dump; also note that it's now hidraw2 as I had to replace the keyboard):
> sudo ./hid-desc /dev/hidraw2
Report Descriptor Size: 171
Report Descriptor:
05 01 09 06 a1 01 85 01 05 07 15 00 25 01 19 e0 29 e7 75 01 95 08 81 02 95 05 75 01 05 08 19 01 29 05 91 02 95 01 75 03 91 03 95 08 75 01 15 00 25 01 06 00 ff 09 03 81 03 95 06 75 08 15 00 25 65 05 07 19 00 29 65 81 00 95 01 75 01 15 00 25 01 05 0c 09 b8 81 02 95 01 75 01 06 00 ff 09 03 81 02 95 01 75 06 81 03 06 02 ff 09 55 85 55 15 00 26 ff 00 75 08 95 40 b1 a2 c0 06 00 ff 09 14 a1 01 85 90 05 84 75 01 95 03 15 00 25 01 09 61 05 85 09 44 09 46 81 02 95 05 81 01 75 08 95 01 15 00 26 ff 00 09 65 81 02 c0 00
Raw Name: Magic Keyboard
Raw Phys: 00:c2:c6:f7:eb:57
Raw Info:
bustype: 5 (Bluetooth)
vendor: 0x004c
product: 0x0267
|
Partial answer: Making sense of the HID infrastructure and the HID raw data
(Disclaimer: I've only done all this for USB, but I suppose it will apply in the same or a similar way to Bluetooth).
HID devices can send and receive reports in a well-defined format. The format for a particular device is given by the HID descriptor, which for USB is very similar to the other USB descriptors (e.g. lsusb can list them if they are not bound). Details (for USB) can be found in the Device Class Definition for Human Interface Devices (HID) PDF document.
Kernel documentation for HID can be found Documentation/hid. As hiddev.txt explains, the dataflow for an event is like this:
usb.c --> hid-core.c --> hid-input.c --> input-subsystem
In drivers/hid/hid-input.c, in particular in the routine hidinput_configure_usage, a report is parsed according to the HID descriptor.
So if you can't see the Fn key, that's where things go wrong.
The output seen at hidraw0 looks suspiciously like there are several kinds of reports with different IDs (this report has ID 1, normal keyboard reports have ID 0).
But to make sure, we need the HID descriptor(s). HID descriptors are available via an ioctl on the hidraw device. You can use for example https://github.com/DIGImend/usbhid-dump to get the descriptor (USB only), and https://github.com/DIGImend/hidrd to parse it. There's also /samples/hidraw/hid-example.c file in the kernel source that shows how to get the HID descriptor via the ioctl; it can be easily modified to produce an hex-dump similar to usbhid-dump. You'll have to use this for Bluetooth, so I put it in a pastebin. Compile with make.
(If you are not used to compiling external projects: Download zip file for both, unpack each into an empty directory, ./bootstrap, ./configure, make. Now you can use the binaries directly, add them $PATH, etc.)
Now you can parse the descriptor using
sudo ./hid-desc /dev/hidraw0 | tail -n+3 | head -1 | hidrd-convert -ihex -ospec
In addition to providing this output (or the hexdump, if anything doesn't work), please test what happens on hidraw if you press the Fn in combination with various other keys (alphabetic, arrows). Also test what happens for normal keypresses.
I'm not sure about the best way to proceed if it's not possible to make the kernel recognize the special reports. Maybe the simplest way is to write a C program that analyzes events from hidraw and produces additional input-events, similarly to input-create.
Update: The HID descriptor contains an extra 00 at the end. If you remove that, it parses to
Usage Page (Desktop), ; Generic desktop controls (01h)
Usage (Keyboard), ; Keyboard (06h, application collection)
Collection (Application),
Report ID (1), ; +00 report id
Usage Page (Keyboard), ; Keyboard/keypad (07h)
Logical Minimum (0),
Logical Maximum (1),
Usage Minimum (KB Leftcontrol), ; Keyboard left control (E0h, dynamic value)
Usage Maximum (KB Right GUI), ; Keyboard right GUI (E7h, dynamic value)
Report Size (1),
Report Count (8),
Input (Variable), ; +01 modifier
Report Count (5),
Report Size (1),
Usage Page (LED), ; LEDs (08h)
Usage Minimum (01h),
Usage Maximum (05h),
Output (Variable),
Report Count (1),
Report Size (3),
Output (Constant, Variable),
Report Count (8),
Report Size (1),
Logical Minimum (0),
Logical Maximum (1),
Usage Page (FF00h), ; FF00h, vendor-defined
Usage (03h),
Input (Constant, Variable), ; +02 vendor
Report Count (6),
Report Size (8),
Logical Minimum (0),
Logical Maximum (101),
Usage Page (Keyboard), ; Keyboard/keypad (07h)
Usage Minimum (None), ; No event (00h, selector)
Usage Maximum (KB Application), ; Keyboard Application (65h, selector)
Input, ; +03 6 keysym bytes
Report Count (1),
Report Size (1),
Logical Minimum (0),
Logical Maximum (1),
Usage Page (Consumer), ; Consumer (0Ch)
Usage (Eject), ; Eject (B8h, one-shot control)
Input (Variable), : +09.0
Report Count (1),
Report Size (1),
Usage Page (FF00h), ; FF00h, vendor-defined
Usage (03h),
Input (Variable), ; +09.1
Report Count (1),
Report Size (6),
Input (Constant, Variable), : +09.2-7
Usage Page (FF02h), ; FF02h, vendor-defined
Usage (55h),
Report ID (85),
Logical Minimum (0),
Logical Maximum (255),
Report Size (8),
Report Count (64),
Feature (Variable, No Preferred, Volatile),
End Collection,
Usage Page (FF00h), ; FF00h, vendor-defined
Usage (14h),
Collection (Application),
Report ID (144),
Usage Page (Power Device), ; Power device (84h, power page)
Report Size (1),
Report Count (3),
Logical Minimum (0),
Logical Maximum (1),
Usage (61h),
Usage Page (Power Batsys), ; Power battery system (85h, power page)
Usage (44h),
Usage (46h),
Input (Variable),
Report Count (5),
Input (Constant),
Report Size (8),
Report Count (1),
Logical Minimum (0),
Logical Maximum (255),
Usage (65h),
Input (Variable),
End Collection
There is one input event report with id hex 01, one battery status report with id hex 90, one output to set the LEDs as usual, and one vendor-specific feature control.
I marked the bytes for the input event report. There's several vendor defined field where we don't know what they do, and have to guess.
The input event report consists of 10 bytes, and your examples decode as follows:
ID MM VA K1 K2 K3 K4 K5 K6 VB
01 00 00 00 00 00 00 00 00 02 ; press? Fn
01 00 00 00 00 00 00 00 00 00 ; release? Fn
01 00 00 3b 00 00 00 00 00 00 ; press F2
01 00 00 00 00 00 00 00 00 00 ; release
01 00 00 00 00 00 00 00 00 00 ;
01 00 00 00 00 00 00 00 00 02 ; press Fn?
01 00 00 3b 00 00 00 00 00 02 ; press F2
01 00 00 00 00 00 00 00 00 02 ; release F2 (but not Fn?)
ID is the report it. MM are the standard 8 modifier bits, which don't have room for the Fn key. K1 to K6 are up to 6 keys pressed simultanously. VA and VB are vendor specific. Assuming you held Fn and just pressed and released F2 in the last example, my guess is that bit 1 in VB represents the modifier for Fn (or at least something related to it).
Use hexdump -e '10/1 "%02X ""\n"' to get 9 bytes of output per line, and test this hypothesis by combining Fn with several keys, including those combinations you want to redefine in the end.
Update: For completeness and future reference, though I assume it's not relevant anymore for this particular case: It's possible to inject HID events using UHID, see Documentation/hid/uhid.txt and samples/uhid/uhid-example.c in the kernel.
| Fn key for Bluetooth Apple Magic Keyboard (2015) |
1,536,681,940,000 |
Since upgrading to 12.04, I've randomly experienced this strange phenomenon where my mouse mostly doesn't work and keyboard mostly does. I have not been able to identify a cause for this. Sometimes it will happen minutes after I start-up, other times after the computer has been idle for a while, and other times in the middle of working on something. It lasts until I reboot the computer or restart Gnome.
The mouse won't be able to interact with any open windows, but if I do ALT+Tab, I can't keyboard nav through those, I can only click to change windows that way. Same if I press the Windows key; the keyboard remains focused in whatever window was just active but I can click things with my mouse to open new programs.
Anyone else experienced this? What might be causing it? Is there a fix?
|
I have seen such behaviour with wireless mice with low battery... try another mouse?
Failing USB mice can also behave erratically, in my experience.
| Ubuntu 12.04 Gnome 3 "freezes" randomly - not a normal freeze though |
1,536,681,940,000 |
All adding the U.S. English International (with dead keys) keyboard layout breaks my Alt_R key. Any ideas why?
I'm working on RHEL 5.5 using GNOME. The problem disappears if I remove the additional layout and reappears if I add it back.
Specific problems include Alt-F2 not working to start the run application app if using Alt_R and CTRL-Alt-L not working for screen looking again if using Alt_R.
I tried using xev to troubleshoot. Here's what I get with just the U.S. English layout:
KeyPress event, serial 29, synthetic NO, window 0x1e00001,
root 0x3a2, subw 0x0, time 1766794207, (169,-13), root:(2099,35),
state 0x0, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 29, synthetic NO, window 0x1e00001,
root 0x3a2, subw 0x0, time 1766794447, (169,-13), root:(2099,35),
state 0x8, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
Here's what I get with the U.S. English International (with dead keys) layout:
KeyPress event, serial 26, synthetic NO, window 0x1e00001,
root 0x3a2, subw 0x0, time 1766853750, (169,-13), root:(2099,35),
state 0x0, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 29, synthetic NO, window 0x1e00001,
root 0x3a2, subw 0x0, time 1766853872, (169,-13), root:(2099,35),
state 0x80, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
It makes no difference whether that layout is actually being used at the moment. Just having it in the selected list breaks things. If this is a bug, does anyone know where it should be filed (GNOME, Xorg, Redhat)?
EDIT: I realized now that I can see my modifier mapping using xmodmap. Initially, mod5 was mapped to mod5 Mode_switch (0x5d) and ISO_Level3_Shift (0x7c). Adding the international layout, maps Alt_R (0x71) to mod5 as well, which why I'm having this problem. Based on Caleb's recommendation, I switched Alt_R to be an ISO_Level3_Shift such that mod5 is now mapped to "mod5 Mode_switch (0x5d), ISO_Level3_Shift (0x71), ISO_Level3_Shift (0x7c)". This still breaks Alt_R as an Alt_L alternative though.
|
Most keyboard layouts outside the U.S. attribute the right Alt key to a different purpose, called AltGr (Alt Graph), which sort of makes the U.S. the exception to the rule. The AltGr key is sort of another kind of Shift key, intended to select extra characters available on the other keys. See the Wikipedia article on AltGr.
So, if you want to issue a key combination with the Alt modifier, like Alt-F2 or Ctrl-Alt-L, be sure to press the left Alt key, since the right one has another purpose. It is just in the U.S. English layout that has no other use for that key that reassigns it (or better, keeps the original old assignment) as an additional Alt key. Even the British English layout uses AltGr to issue characters like “€” and “£”.
| Why does US International Keyboard break Alt_R |
1,536,681,940,000 |
I have a Dell Latitude 5500 and a Dell Latitude 7550. The 5500 has Debian 10 and KDE, and the 7550 has Ubuntu 20.04 with KDE. In both laptops, if I close the lid, when I open it later the built-in laptop keyboard is completely locked-up and I can't type anything. The trackpad still works though and I am able to click on "switch user". When I do this and get prompted to login again, the laptop keyboard starts working again on both laptops.
I'm not sure if this is an issue, but I have an external 10-port USB hub plugged into the laptops. I have an external keyboard and mouse plugged into them. The external keyboard also locks up, but the external mouse also works.
Why would closing the laptop lid cause the keyboard to lock up? Is there anything I can do to fix it?
dmesg output:
[Sat Jun 26 10:46:51 2021] usb 2-1.4: Disable of device-initiated U1 failed.
[Sat Jun 26 10:46:51 2021] usb 2-1.4: Disable of device-initiated U2 failed.
[Sat Jun 26 10:46:51 2021] usb 2-1.4: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[Sat Jun 26 10:46:52 2021] usb 2-1.4: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[Sat Jun 26 23:15:15 2021] usb 2-1.4: Disable of device-initiated U1 failed.
[Sat Jun 26 23:15:15 2021] usb 2-1.4: Disable of device-initiated U2 failed.
[Sat Jun 26 23:15:15 2021] usb 2-1.4: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[Sat Jun 26 23:15:16 2021] usb 2-1.4: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[Mon Jun 28 01:54:59 2021] usb 2-1.4: Disable of device-initiated U1 failed.
[Mon Jun 28 01:54:59 2021] usb 2-1.4: Disable of device-initiated U2 failed.
[Mon Jun 28 01:54:59 2021] usb 2-1.4: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[Mon Jun 28 01:54:59 2021] usb 2-1.4: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[Mon Jun 28 07:34:57 2021] usb 2-1: USB disconnect, device number 2
[Mon Jun 28 07:34:57 2021] usb 2-1.3: USB disconnect, device number 4
[Mon Jun 28 07:34:57 2021] usb 2-1.4: USB disconnect, device number 5
[Mon Jun 28 07:34:57 2021] usb 1-1: USB disconnect, device number 2
[Mon Jun 28 07:34:57 2021] usb 1-1.2: USB disconnect, device number 4
[Mon Jun 28 07:34:57 2021] usb 1-1.3: USB disconnect, device number 6
[Mon Jun 28 07:34:57 2021] usb 1-1.3.2: USB disconnect, device number 8
[Mon Jun 28 07:34:57 2021] usb 1-1.3.4: USB disconnect, device number 9
[Mon Jun 28 07:34:57 2021] usb 1-1.4: USB disconnect, device number 7
[Mon Jun 28 07:35:06 2021] usb 1-1: new high-speed USB device number 10 using xhci_hcd
[Mon Jun 28 07:35:06 2021] usb 1-1: New USB device found, idVendor=2109, idProduct=2812, bcdDevice=85.80
[Mon Jun 28 07:35:06 2021] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[Mon Jun 28 07:35:06 2021] usb 1-1: Product: USB2.0 Hub
[Mon Jun 28 07:35:06 2021] hub 1-1:1.0: USB hub found
[Mon Jun 28 07:35:06 2021] hub 1-1:1.0: 4 ports detected
[Mon Jun 28 07:35:06 2021] usb 2-1: new SuperSpeed Gen 1 USB device number 11 using xhci_hcd
[Mon Jun 28 07:35:06 2021] usb 2-1: New USB device found, idVendor=2109, idProduct=0812, bcdDevice=85.81
[Mon Jun 28 07:35:06 2021] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Mon Jun 28 07:35:06 2021] usb 2-1: Product: USB3.0 Hub
[Mon Jun 28 07:35:06 2021] usb 2-1: Manufacturer: VIA Labs, Inc.
[Mon Jun 28 07:35:06 2021] hub 2-1:1.0: USB hub found
[Mon Jun 28 07:35:06 2021] hub 2-1:1.0: 4 ports detected
[Mon Jun 28 07:35:06 2021] usb 1-1.2: new full-speed USB device number 11 using xhci_hcd
[Mon Jun 28 07:35:07 2021] usb 2-1.3: new SuperSpeed Gen 1 USB device number 12 using xhci_hcd
[Mon Jun 28 07:35:07 2021] usb 2-1.3: New USB device found, idVendor=2109, idProduct=0812, bcdDevice=85.81
[Mon Jun 28 07:35:07 2021] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Mon Jun 28 07:35:07 2021] usb 2-1.3: Product: USB3.0 Hub
[Mon Jun 28 07:35:07 2021] usb 2-1.3: Manufacturer: VIA Labs, Inc.
[Mon Jun 28 07:35:07 2021] hub 2-1.3:1.0: USB hub found
[Mon Jun 28 07:35:07 2021] hub 2-1.3:1.0: 4 ports detected
[Mon Jun 28 07:35:07 2021] usb 1-1.2: New USB device found, idVendor=046d, idProduct=0a8f, bcdDevice= 0.12
[Mon Jun 28 07:35:07 2021] usb 1-1.2: New USB device strings: Mfr=3, Product=1, SerialNumber=0
[Mon Jun 28 07:35:07 2021] usb 1-1.2: Product: Logitech USB Headset
[Mon Jun 28 07:35:07 2021] usb 1-1.2: Manufacturer: Logitech USB Headset
[Mon Jun 28 07:35:07 2021] usb 2-1.4: new SuperSpeed Gen 1 USB device number 13 using xhci_hcd
[Mon Jun 28 07:35:07 2021] usb 2-1.4: New USB device found, idVendor=2109, idProduct=0812, bcdDevice=85.81
[Mon Jun 28 07:35:07 2021] usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Mon Jun 28 07:35:07 2021] usb 2-1.4: Product: USB3.0 Hub
[Mon Jun 28 07:35:07 2021] usb 2-1.4: Manufacturer: VIA Labs, Inc.
[Mon Jun 28 07:35:07 2021] hub 2-1.4:1.0: USB hub found
[Mon Jun 28 07:35:07 2021] hub 2-1.4:1.0: 4 ports detected
[Mon Jun 28 07:35:08 2021] input: Logitech USB Headset Logitech USB Headset as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:046D:0A8F.0007/input/input34
[Mon Jun 28 07:35:08 2021] hid-generic 0003:046D:0A8F.0007: input,hidraw1: USB HID v1.11 Device [Logitech USB Headset Logitech USB Headset] on usb-0000:00:14.0-1.2/input3
[Mon Jun 28 07:35:08 2021] usb 1-1.3: new high-speed USB device number 12 using xhci_hcd
[Mon Jun 28 07:35:08 2021] usb 1-1.3: New USB device found, idVendor=2109, idProduct=2812, bcdDevice=85.80
[Mon Jun 28 07:35:08 2021] usb 1-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[Mon Jun 28 07:35:08 2021] usb 1-1.3: Product: USB2.0 Hub
[Mon Jun 28 07:35:08 2021] hub 1-1.3:1.0: USB hub found
[Mon Jun 28 07:35:08 2021] hub 1-1.3:1.0: 4 ports detected
[Mon Jun 28 07:35:08 2021] usb 1-1.4: new high-speed USB device number 13 using xhci_hcd
[Mon Jun 28 07:35:08 2021] usb 1-1.4: New USB device found, idVendor=2109, idProduct=2812, bcdDevice=85.80
[Mon Jun 28 07:35:08 2021] usb 1-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[Mon Jun 28 07:35:08 2021] usb 1-1.4: Product: USB2.0 Hub
[Mon Jun 28 07:35:08 2021] hub 1-1.4:1.0: USB hub found
[Mon Jun 28 07:35:08 2021] hub 1-1.4:1.0: 4 ports detected
[Mon Jun 28 07:35:08 2021] usb 1-1.3.2: new low-speed USB device number 14 using xhci_hcd
[Mon Jun 28 07:35:09 2021] usb 1-1.3.2: New USB device found, idVendor=046d, idProduct=c00e, bcdDevice=11.10
[Mon Jun 28 07:35:09 2021] usb 1-1.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Mon Jun 28 07:35:09 2021] usb 1-1.3.2: Product: USB-PS/2 Optical Mouse
[Mon Jun 28 07:35:09 2021] usb 1-1.3.2: Manufacturer: Logitech
[Mon Jun 28 07:35:09 2021] input: Logitech USB-PS/2 Optical Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.3/1-1.3.2/1-1.3.2:1.0/0003:046D:C00E.0008/input/input35
[Mon Jun 28 07:35:09 2021] hid-generic 0003:046D:C00E.0008: input,hidraw2: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:14.0-1.3.2/input0
[Mon Jun 28 07:35:09 2021] usb 1-1.3.4: new low-speed USB device number 15 using xhci_hcd
[Mon Jun 28 07:35:09 2021] usb 1-1.3.4: New USB device found, idVendor=046d, idProduct=c31c, bcdDevice=64.02
[Mon Jun 28 07:35:09 2021] usb 1-1.3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Mon Jun 28 07:35:09 2021] usb 1-1.3.4: Product: USB Keyboard
[Mon Jun 28 07:35:09 2021] usb 1-1.3.4: Manufacturer: Logitech
[Mon Jun 28 07:35:09 2021] input: Logitech USB Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.0/0003:046D:C31C.0009/input/input36
[Mon Jun 28 07:35:09 2021] hid-generic 0003:046D:C31C.0009: input,hidraw3: USB HID v1.10 Keyboard [Logitech USB Keyboard] on usb-0000:00:14.0-1.3.4/input0
[Mon Jun 28 07:35:09 2021] input: Logitech USB Keyboard Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.1/0003:046D:C31C.000A/input/input37
[Mon Jun 28 07:35:09 2021] input: Logitech USB Keyboard System Control as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.1/0003:046D:C31C.000A/input/input38
[Mon Jun 28 07:35:09 2021] hid-generic 0003:046D:C31C.000A: input,hiddev0,hidraw4: USB HID v1.10 Device [Logitech USB Keyboard] on usb-0000:00:14.0-1.3.4/input1
[Mon Jun 28 07:35:25 2021] kscreen_backend[162047]: segfault at 10 ip 00007fdb6825df6b sp 00007ffd034223b0 error 4 in KSC_XRandR.so[7fdb68246000+1b000]
[Mon Jun 28 07:35:25 2021] Code: 73 1c e8 58 97 fe ff 49 8b 3c 24 48 8d 73 14 e8 eb 96 fe ff 49 8b 3c 24 48 8d 73 24 e8 2e 93 fe ff e8 e9 b9 fe ff 49 8b 3c 24 <0f> b7 70 10 48 89 c5 e8 d9 92 fe ff 48 89 ef e8 e1 8f fe ff 4c 89
Output of grep "GRUB_CMDLINE_LINUX_DEFAULT=" /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
|
Alright, so.
In a terminal, open /etc/default/grub.
Find the line that starts with GRUB_CMDLINE_LINUX_DEFAULT=.
Replace it with GRUB_CMDLINE_LINUX_DEFAULT="atkbd.reset i8042.reset i8042.nomux quiet splash".
Save and exit the file.
Run sudo update-grub.
If this doesn't work, follow the same process but try GRUB_CMDLINE_LINUX_DEFAULT="i8042.direct i8042.dumbkbd" instead.
| laptop keyboard locks up after closing lid |
1,536,681,940,000 |
I have a strange issue, and really not sure how to search for a similar question on StackExchange.
This is related to Ubuntu 20.04 command-line.
When I press TAB key, which 'autocompletes' appends really weird results as part of the 'input for my current command'.
For instance:
Typing: (cd and pressing TAB afterwards)
....
cd words=("${@:3:2}")
cword="$3"
cur="$3"
cur="$3"
cword="$3"
prev="$3"
words=("${@:3:2}")
stage^C
Same when typing bash + TAB
bash words=("${@:3:2}")
cword="$3"
cur="$3"
cur="$3"
cword="$3"
prev="$3"
words=("${@:3:2}")
^C
Shell autocomplete is behaving strangely recently, not sure how to fix this. (Also apologies again, I really do not know how to phrase this correctly or even find a similar question).
NOTE:
reset only clears the console, but the issue still remains afterwards!
|
I assume your shell is Bash. I can replicate your problem by redefining eval like this:
eval() { echo "$1"; }
or similarly. Completion functions use eval. They expect eval to be eval the shell builtin. If eval is tampered with then they may misbehave.
My tests indicate that eval being an alias or an executable does not break completions, so it's most likely a function in your case.
Invoke
type eval
Normally the output should be eval is a shell builtin. If you get eval is a function then invoke
unset -f eval
and check if completions behave better (or at least differently).
You should investigate where the function comes from. A manual method is to check the startup files (~/.bashrc and such) and everything they source. There are better methods. Proceed like this:
shopt -s extdebug # enable extra debugging info
declare -F eval
This will tell you the line number and the source file. (Finally run shopt -u extdebug to disable debugging.)
The above method should be enough to locate the definition of the function. Just in case, few other methods are here: How to find the file where a bash function is defined.
After you find the definition of this eval function, get rid of it and let eval be the builtin. Notes:
Deleting the definition will not automatically fix already running shells. Spawn a new shell; log out and log in; when in doubt, reboot.
Deleting the definition will break anything that actually needs the function, so further investigation may be required: for what reason was the function there? Consider renaming instead of deleting (at least initially, temporarily), in case the code in the definition is not expendable.
The function may be defined more than once (and the most recently sourced definition wins). If deleting the definition does not bring the builtin back, there's probably a definition left. Repeat the method.
If completions are not fully fixed, examine the output of declare -F and check for other functions that replace builtins (use compgen -b to know what to search for). If needed, analyze them like you just did with eval and fix similarly.
| Ubuntu 20.04 Shell - pressing TAB shows weird 'autocomplete output' |
1,536,681,940,000 |
I recently installed dwm (a linux window manager) which extensivley uses Alt+Shift key combinations for navigation but none of them are working. For example Alt+Shift+c will close a window.
I installed screenkey to check if my keyboard was working and saw that when I pressed Alt+Shift it registered as Alt+ISO_Next_Group. When I pressed Alt+Shift+c it registered as Alt+ISO_Next_Group then Alt+c.
I found this Arch Wiki page which mentions ISO_Next_Group but does not seem to suggest any solutions. What can I do to get Alt+Shift working again?
|
My issue was actually particular to MX-Linux. By default the "Layout Switch" key is set to Alt+Shift. You can change this in fskbsettings which is installed by default.
| Alt+Shift Not Working, Getting Alt+ISO_Next_Group Instead |
1,536,681,940,000 |
I created the file 00-keyboard.conf in /etc/X11/xorg.conf.d/ with the following options:
Section "InputClass"
Identifier "system-keyboard"
Option "XkbLayout" "latam,ru"
Option "XkbVariant" ",qwerty"
Option "XkbOptions" "grp:alt_shift_toggle"
EndSection
The output from /var/log/Xorg.0.log is
[ 29.431] (**) HP Wireless hotkeys: Applying InputClass "system-keyboard"
[ 29.431] (II) Using input driver 'evdev' for 'HP Wireless hotkeys'
[ 29.431] (**) HP Wireless hotkeys: always reports core events
[ 29.432] (**) evdev: HP Wireless hotkeys: Device: "/dev/input/event8"
[ 29.432] (--) evdev: HP Wireless hotkeys: Vendor 0 Product 0
[ 29.432] (--) evdev: HP Wireless hotkeys: Found keys
[ 29.432] (II) evdev: HP Wireless hotkeys: Configuring as keyboard
[ 29.432] (**) Option "config_info" "udev:/sys/devices/virtual/input/input9/event8"
[ 29.432] (II) XINPUT: Adding extended input device "HP Wireless hotkeys" (type: KEYBOARD, id 15)
[ 29.432] (**) Option "xkb_rules" "evdev"
[ 29.432] (**) Option "xkb_model" "pc105"
[ 29.432] (**) Option "xkb_layout" "latam,ru"
[ 29.432] (**) Option "xkb_variant" ",qwerty"
[ 29.432] (**) Option "xkb_options" "grp:alt_shift_toggle"
[ 459.494] (II) intel(0): EDID vendor "LGD", prod id 902
[ 459.494] (II) intel(0): Printing DDC gathered Modelines:
[ 459.494] (II) intel(0): Modeline "1366x768"x0.0 76.40 1366 1402 1450 1610 768 771 776 790 +hsync -vsync (47.5 kHz eP)
[ 459.494] (II) intel(0): Modeline "1366x768"x0.0 50.93 1366 1402 1450 1610 768 771 776 790 +hsync -vsync (31.6 kHz e)
This is the output from localectl status
System Locale: LANG=es_CL.UTF-8
LANGUAGE=es_CL:es
VC Keymap: n/a
X11 Layout: latam
X11 Model: pc105
Pressing Alt + Shift does nothing. I am in Debian Jessie.
However, setxkbmap -option grp:alt_shift_toggle latam,ru works as expected.
|
If you run setxkbmap and then the keybinding works, you can execute the command when you start the session. This works for me in Openbox: i've included the command in ~/.config/openbox/autostart:
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll latam,ru
You can change the keys combination of course. The full list:
grep "grp:.*toggle" /usr/share/X11/xkb/rules/base.lst
And to see the current configuration of your keyboard:
setxkbmap -print -verbose 10
| Keyboard layout toggle key combination not working |
1,536,681,940,000 |
I have an OSX laptop with a running Ubuntu Virtualbox and I either interact with it with the laptop keyboard or with an external USB keyboard that I plug in when in the office.
Is there a script I could run to detect if the external keyboard is plugged so that the keymap in Ubuntu Virtualbox changes accordingly?
I currently manually run either 'mac' or 'key' which executes this command:
setxkbmap -layout gb
or
xmodmap .Xmodmap
I would like to do the same automatically when the keyboard is plugged or unplugged. Any ideas?
|
You can use a udev-rule for this. In my example I am using a USB dongle for my wireless mouse, you will have to adjust accordingly:
1. Getting the identifiers
In order to make a unique rule for the device, we need to identify it properly. Use the output of udevadm for this ( your USB keyboard should show in /dev/usb/<device>. Plug it in and out to see if this device (dis)appears ). The vendor and device IDs should be unique enough, but the more matches, the better.
udeadm info -a -n /dev/usb/hiddev0 | grep 'idVendor\|idProduct'
ATTRS{idVendor}=="0e8f"
ATTRS{idProduct}=="00a4"
ATTRS{idVendor}=="1d6b"
ATTRS{idProduct}=="0001"
Note the two values that match the output from lsusb at ID (to know which device this is, either test the difference of lsubs with and without the keyboard, or see if you can match the names in the output)
lsusb
Bus 005 Device 004: ID 0e8f:00a4 GreenAsia Inc.
So we will use 0e8f and 00a4 for vendor and product ID, respectively.
2. Creating a rule
The rule itself is just a listing of what to do. Save it in /etc/udev/rules.d/ as e.g. keyboard.rules (note that the .rules suffix is obligatory). The file will match (==) a few attributes, the action, and run our script:
ACTION=="add", ATTRS{idVendor}=="0e8f", ATTRS{idProduct}=="00a4", RUN+="/full/path/to/script.sh"
You might run into problems for the ACTION=="remove" part, have a read of this. The problem being some of the attributes being deleted upon removal, and thus udev cannot match them anymore for your removal rule.
In my case I used udeadm monitor --environemnt and unplugged the devive. I selected
ID_MODEL_ID=00a4
and used this as the only requirement (you might need to do a bit of trial and error for good matches here, however a single match is rather save for your case of changing keymaps only). Note that the removal rule needs ENV instead of ATTRS (AFAIK ENV works for the plugin rule, too, but ATTRS fails for removal)
ACTION=="remove", ENV{ID_MODEL_ID}=="00a4", RUN+="/path/to/removal_script.sh"
The add and remove rules can be one file with one line for each action.
3. The script
The script will ALWAYS be run by root, so make sure that a) it is writeable by root only (for security reasons) b) if your command needs to be executed by a user, use sudo -u user1 command in the script. It should be executable of course.
If you are trying to directly execute a command (i.e. without using a script) use the absolute path of said command.
Good luck.
| linux: detect if external keyboard is plugged to laptop |
1,536,681,940,000 |
I am having trouble understanding the purpose of trap and the multiple stty invocations in the snippet below.
I was hoping someone could give me a rundown of what is happening.
getkey() {
local stty="$(stty -g)"
trap "stty $stty; trap SIGINT; return 128" SIGINT
stty cbreak -echo
local key
while true; do
key=$(dd count=1 2>/dev/null) || return $?
if [ -z "$1" ] || [[ "$key" == [$1] ]]; then
break
fi
done
stty $stty
echo "$key"
return 0
}
|
local stty="$(stty -g)"
Save the current terminal settings. stty $stty, which is executed both when the function returns normally and on SIGINT, restores these settings.
trap "stty $stty; trap SIGINT; return 128" SIGINT
If the function is interrupted by SIGINT (the signal sent by pressing Ctrl+C), restore the terminal settings and return 128. (Why 128? I wonder. Normally the exit status on a signal would be 128 + signal number.)
stty cbreak -echo
Disable the terminal's crude editing functionality (character/word/line erase), and turn off the echo of characters as they are typed.
key=$(dd count=1 2>/dev/null) || return $?
Read up to 512 bytes from the terminal (count is a number of blocks, and the default block size is 512 bytes). This is a bit strange: I think the intent was to read one byte. Since dd will return as soon as at least one byte is available, this will return a single byte in practice if a user is typing, but if a program is feeding keystrokes or if the system is slow, this could read more bytes. The code has the benefit that if the user types a multibyte character, all the bytes that make up the character are likely (but not guaranteed) to be read in the loop iteration.
If dd returns a nonzero status, this indicates a read error or a signal; the function returns immediately. The terminal settings are not restored, which is a bug, though most of the time the error would be either that the user pressed Ctrl+C, in which case the terminal settings are restored, or that the terminal has disappeared, in which case the point is moot.
if [ -z "$1" ] || [[ "$key" == [$1] ]]; then
break
fi
Exit the loop if the byte(s) that was read is one of the characters in the argument to the function. If the argument is empty, any character terminates the loop. The argument isn't exactly a list of characters, it's in wildcard character set syntax: an initial ^ or ! inverts the set, a minus sign in most positions is parsed as a range (e.g. 0-9), [:…:] and [.….] denote character classes and collating symbols respectively, and a backslash quotes the next \, [, ] or -.
| Reading keypresses in shell using trap and Unix signals |
1,536,681,940,000 |
How to use bash command control a Keyboard.
e.g.
what is a command in bash for pressing ctrl+c, ctrl+l, etc..?
|
AutoKey is a desktop automation utility for Linux and X11. It allows the
automation of virtually any task by responding to typed abbreviations and
hotkeys. It offers a full-featured GUI that makes it highly accessible for
novices, as well as Python scripting .... Here is the link to Autokey's homepage.
Note: When I first looked at Autokey, its scripting interface could not handle Unicode fully. I forget exactly how that was, but it was something like it could process UTF-8 internally, but couldn't deliver it to the something-or-other. If it wasn't for that, I'd be using it today; it looks great, and it has a good reputation (I know it from Windows-land). Otherwise, it is quite comprehensive. I believe it is a fork of Autoit3 (again Windows).. I've used Autoit3 and it is absolutely fully featured. I think Autokey is similar.... Autokey is available in the Ubuntu repository..
xdotool lets you programatically (or manually) simulate keyboard
input and mouse activity, move and resize windows, etc.
xdotool key --clearmodifiers --delay 40 "ctrl+shift+u"
Another option is package xmacro. It contains macroplay and xmacrorec (and xmacrorec2). xmacrorec can be used to record mouse and keyboard events on any X11 display. xmacroplay can be used to playback recorded events or send any other mouse/keyboard events you choose.
echo -n "KeyStrPress Control_L
KeyStrPress Alt_L
KeyStrPress a
KeyStrRelease a
KeyStrRelease Alt_L
KeyStrRelease Control_L"|
xmacroplay :0.0 &>/dev/null
| How to use bash control a keyboard |
1,536,681,940,000 |
I can disable Caps Lock in the GUI using following command:
setxkbmap -option ctrl:nocaps
But how can I disable it completely in the console, on a machine without X/GUI ?
|
dumpkeys | sed s/Caps_Lock/Control/ | loadkeys
On Debian and alike, just putting XKBOPTIONS="ctrl:nocaps" in /etc/default/keyboard works for both the console and X11 -- provided that you have the console-setup package installed. Use the setupcon command to immediately re-load that file.
| How to disable CapsLock in console? |
1,536,681,940,000 |
I bought my mom a laptop some time ago with an unfortunate keyboard layout. OS is Linux Mint 18.2 Cinnamon 64-bit.
The thing is, instead of having F1 - F12 keys, she has different buttons for multimedia and more importantly an Airplane mode button. The F1 - F12 keys can be reached via Fn.
Because we have quite many pets, they often jump on the keyboard pressing multiple buttons including the Airplane mode button, thus disconnecting her from internet, which she complains about lately.
In BIOS I don't see a way to switch to normal keyboard layout. So, question for you is:
Is there a way to disable Airplane mode button on laptop keyboard?
EDIT1:
It is impossible to keep the pets out of the room, because they are integral part of our household.
Of course, when mom is not at the computer, she closes the lid. But they jump on the laptop when she is at the laptop. Cats can be real pain in this sense :)
EDIT2:
When Airplane mode is turned off, i.e. wireless is on, the following command:
rfkill list all
outputs:
0: ideapad_wlan: Wireless LAN
Soft blocked: no
Hard blocked: no
1: ideapad_bluetooth: Bluetooth
Soft blocked: yes
Hard blocked: no
2: hci0: Bluetooth
Soft blocked: yes
Hard blocked: no
3: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
EDIT3:
Once Airplane button is pressed the wireless according to the previous command is blocked Soft.
EDIT4:
acpi_listen
when the button is pressed, outputs:
button/wlan WLAN 00000080 00000000 K
EDIT5:
sudo evtest
output:
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: Lid Switch
/dev/input/event1: Power Button
/dev/input/event2: Power Button
/dev/input/event3: AT Translated Set 2 keyboard
/dev/input/event4: MOSART Semi. 2.4G Wireless Mouse
/dev/input/event5: Video Bus
/dev/input/event6: Video Bus
/dev/input/event7: ETPS/2 Elantech Touchpad
/dev/input/event8: Ideapad extra buttons
/dev/input/event9: Lenovo EasyCamera
/dev/input/event10: HDA Intel PCH Mic
/dev/input/event11: HDA Intel PCH Headphone
/dev/input/event12: HDA Intel HDMI HDMI/DP,pcm=3
/dev/input/event13: HDA Intel HDMI HDMI/DP,pcm=7
/dev/input/event14: HDA Intel HDMI HDMI/DP,pcm=8
Select the device event number [0-14]: 8
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "Ideapad extra buttons"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 1 (KEY_ESC)
Event code 148 (KEY_PROG1)
Event code 149 (KEY_PROG2)
Event code 186 (KEY_F16)
Event code 192 (KEY_F22)
Event code 193 (KEY_F23)
Event code 202 (KEY_PROG3)
Event code 203 (KEY_PROG4)
Event code 212 (KEY_CAMERA)
Event code 227 (KEY_SWITCHVIDEOMODE)
Event code 238 (KEY_WLAN)
Event code 240 (KEY_UNKNOWN)
Event code 248 (KEY_MICMUTE)
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1508927031.158643, type 4 (EV_MSC), code 4 (MSC_SCAN), value 0d
Event: time 1508927031.158643, type 1 (EV_KEY), code 238 (KEY_WLAN), value 1
Event: time 1508927031.158643, -------------- SYN_REPORT ------------
Event: time 1508927031.158680, type 1 (EV_KEY), code 238 (KEY_WLAN), value 0
Event: time 1508927031.158680, -------------- SYN_REPORT ------------
|
I do not have the exact hadware, but I tried to find a "similar case" in my system:
One was the power button. Target is to enter a key (eg key "4") instead of power. (for me it sits in /dev/input/event2 and emits a
root# evtest /dev/input/event2
Event: time 1509218410.222521, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1509218410.222521, -------------- SYN_REPORT ------------
Event: time 1509218410.222552, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1509218410.222552, -------------- SYN_REPORT ------------
The other is (this is why I am interested in soo deeply): I also have a WIFI button, but "does not do anything". While I understand input events, I wanna correct this - for fun. Here the target is to do something.
This Fn+F3 emits (from normal keyboard input device)
root# evtest /dev/input/event3
Event: time 1509218870.384483, type 4 (EV_MSC), code 4 (MSC_SCAN), value 86
Event: time 1509218870.384483, -------------- SYN_REPORT ------------
This Fn+F3 originally gave a warning line in syslog
kernel: [44802.485207] atkbd serio0: Unknown key released (translated set 2, code 0x86 on isa0060/serio0).
kernel: [44802.485210] atkbd serio0: Use 'setkeycodes e006 ' to make it known.
What I did so far:
run many series of setkeycodes
Neither evdev nor "real life" ever saw any changes, however with setkeycodes e006 5 or setkeycodes 86 5 the syslog entry was gone.
created hwdb file in /etc/udev/hwdb similar like - this eliminated the syslog message also - BUT DID NOTHING ELSE:
evdev:atkbd:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr*
KEYBOARD_KEY_86=5
created udev rule in /etc/udev/rules.d (and made it effect)
it runs (because I see the "Power button INHIBIT string" and see all modified tags), I can change any attribute (played mainly for power button)
Here is my rule file:
ACTION!="add|change", GOTO="pwr_kbd_end"
SUBSYSTEM!="input", GOTO="pwr_kbd_end"
KERNEL!="event[0-9]*", GOTO="pwr_kbd_end"
ENV{ID_PATH_TAG}=="acpi-LNXPWRBN_00", OPTIONS+="last_rule", RUN+="/usr/bin/logger -t Power button INHIBIT %k", ENV{KEYBOARD_KEY_116}="KEY_A",\ TAG:="whatisthis", ENV{EV_KEY_116}="KEY_B", \ ENV{BTN_116}="KEY_C",ENV{BTN_POWER}="KEY_D", ENV{KEY_POWER}="KEY_E"
LABEL="pwr_kbd_end"
However I read and realized that rules are for "system changes", like connecting or disconnecting something, modifying (like making new partition, or playing with modechange 3G dongles), but they are nothing to do with the actual key event handling (however they could have influence). Meanwhile OPTIONS+="last_rule" seems not working - I entered this file as 01-myrule.rule and as a hard link 98-myrule.rule - both are "working".
Then I focused my interest to handle the events:
I copied a evtest.py python script and played a bit.
My concept was "intercept the power putton event, do not pass through and inject another one (eg KEY_4 - value 5 - as I tried in my previous tests).
THIS was almost total success. (this could be your solution as well)
from __future__ import print_function
import sys
import select
from evdev import ecodes, list_devices, AbsInfo, InputDevice, UInput
def main():
device = InputDevice("/dev/input/event2") # yours should be checked... NOT necessalirly always event8
device.grab()
ui = UInput()
print('Listening for events (press ctrl-c to exit) ...')
fd_to_device = {device.fd: device}
while True:
r, w, e = select.select(fd_to_device, [], [])
for fd in r:
for event in fd_to_device[fd].read():
if (event.type == 1) and (event.code==116): # yours is 238
print_event(event)
event.code=5
event.value=1
ui.write(event.type, event.code, event.value) # just delete/comment this section if you do not wanna do anything
ui.syn
event.value=0
ui.write(event.type, event.code, event.value)
ui.syn
else:
ui.write(event.type, event.code, event.value)
ui.syn
def print_event(e):
if e.type == ecodes.EV_SYN:
if e.code == ecodes.SYN_MT_REPORT:
msg = 'time {:<16} +++++++++ {} ++++++++'
else:
msg = 'time {:<16} --------- {} --------'
print(msg.format(e.timestamp(), ecodes.SYN[e.code]))
else:
if e.type in ecodes.bytype:
codename = ecodes.bytype[e.type][e.code]
else:
codename = '?'
evfmt = 'time {:<16} type {} ({}), code {:<4} ({}), value {}'
print(evfmt.format(e.timestamp(), e.type, ecodes.EV[e.type], e.code, codename, e.value))
if __name__ == '__main__':
try:
ret = main()
except KeyboardInterrupt:
ret = 0
sys.exit(ret)
Again, no matter if I am in console or X - when this script is running, I get a key (currently it is doubble somehow) instead of "power switch".
I intercepted (but let them pass through the keyboard events) and when I found my magical 86 code, I injected an EV_KEY sequence (EV_KEY KEY_4 down, SYN, EV_KEY KEY_4 up, SYN)
This is partial success however, because events somehow stuck and wait for each other and they show up as a bunch of 4 (I used python -u wifi.py) - so I try to be unbuffered. Here there is no doubbling: I press the Wifi button 4 times, I get '4444' - in console, as well as in X.
| Is there a way to disable Airplane mode button on laptop keyboard? |
1,536,681,940,000 |
I'm having a hard time finding a "command character" for GNU-screen that does not collide with some key combination that I already use.
Through Emacs (and org-mode, and my regular shell, etc.), pretty much all the command characters consisting of Ctrl + [A-Z] are off-limits.
I figure that, if there were a simple, and consistent, way to type any one of the characters in the ASCII range 27 through 31, that may do the trick.
Are there any tools I could use to find a way to type one of these characters that fits the above criteria?
(BTW, by "consistent" I mean that it can be typed the same way in "all keyboards", or at least in "all US keyboards".)
|
You can use any function key that Screen recognizes as the escape character. Set the escape character (more precisely, the escape byte) to one that you never type, for example \377 which is never used by UTF-8. Bind the key you want to use as the escape key to command, for example F12 (which is F2 in termcap speak — see the section “Input translation” in the Screen manual):
escape \377\377
bindkey -k F2 command
You aren't limited to keys for which Screen knows a symbolic name. To set an arbitrary key or keychord as the command key (the key does need to send an escape sequence in the terminal), find out what escape sequence it sends by pressing Ctrl+V then that key at a shell prompt. This causes the escape sequence to be inserted literally, instead of being recognized by the shell as an escape sequence. For example, if you wanted to use F12, you could press Ctrl+V then F12, which inserts ^[[24~ (the first ^[ represents the escape character) (some terminals may send a different escape sequence); then you would use
bindkey ^[[24~ command
I use Ctrl+\ as my Screen escape key (escape ^\\\), and let Ctrl+\ \ inject a ^\ character. Few programs use the ^\ control character. In Emacs, it calls toggle-input-method, which I don't use; your mileage may vary. In a cooked terminal, it sends SIGQUIT, which is rarely useful (when it's needed, Ctrl+Z followed by the kill command usually works as well; I default to having core dumps disabled). Ctrl+\ can be difficult to type on some keyboard layouts where \ requires AltGr, but on the US layout it's straightforward. I also configure my terminal emulator to send the ^\ character when I press Ctrl+`, which lets me type it with the left hand as well.
Ctrl+] (Emacs: abort-recursive-edit) and Ctrl+^ (Emacs: undefined; but it's awkward to type on a US keyboard as well as on many other layouts) are other likely candidates for an Emacs user.
By the way, if you only use Screen to run Emacs and some shells, you don't need Screen. Emacs can play the same role. Keep a single Emacs process running, and use emacsclient to open a window on this Emacs process from any terminal. If the terminal goes away, you can run emacsclient again to connect to the same Emacs instance. You can have as many instances of emacsclient as you like that are connected to the same Emacs instance, possibly displaying through different local and remote connections.
To start Emacs with no interface, run emacs --daemon. Then run emacsclient -c to open a window to the existing Emacs instance (or emacsclient -c -nw to force a text mode window). If you want to start Emacs if it wasn't already started but connect to the existing Emacs instance if there is one, run emacsclient -a '' -c.
If you want to run shells, you can use M-x shell or M-x term or the like inside Emacs. Emacs can do pretty much everything Screen can do.
| How to search for a suitable "command character" for GNU-screen? |
1,536,681,940,000 |
I have zsh shell in a Linux server, and connect to the server from screen sessions in different computers. I'm trying to get control keys, such as home and end, to function correctly.
Because zsh doesn't use the GNU Readline library, I need to take care of mapping the terminal sequences to zsh commands. First I use zkbd to find out the sequences sent by each key stroke, and then I map them to the correct commands. This is what I have in .zshrc:
autoload zkbd
[ ! -f "${ZDOTDIR:-$HOME}/.zkbd/$TERM-${DISPLAY:-$VENDOR-$OSTYPE}" ] && zkbd
source "${ZDOTDIR:-$HOME}/.zkbd/$TERM-${DISPLAY:-$VENDOR-$OSTYPE}"
[ -n "${key[Backspace]}" ] && bindkey "${key[Backspace]}" backward-delete-char
[ -n "${key[Home]}" ] && bindkey "${key[Home]}" beginning-of-line
...
Now I have two problems:
Usually when I connect to the server, the sequence number in $DISPLAY environment variable gets a new value. Consequently, zkbd gets run, and I have to go through pressing all the control keys. Is it necessary to have the key sequences dependent on $DISPLAY?
When I connect to the server from a screen session, $TERM environment variable will be set to screen. Still, depending on which computer I'm connecting from, the sequences of some keys differ (e.g. F1 is either ^[[11~ or ^[OP). How should I name the zkbd files in order to distinguish between the different mappings?
|
Rather than simply use TERM=screen, the screen program has a feature which you could use to set different values of TERM. This assumes that you've installed a complete ncurses terminal database, and use a TERM outside screen that corresponds to the actual terminal.
For a given TERM, if there is a corresponding "screen.$TERM" entry in the terminal database, then screen will use that. The ncurses terminal database has several of these, to match the actual behavior of terminals that set TERM=xterm, e.g.,
screen.Eterm,
screen.gnome,
screen.konsole,
screen.konsole-256color,
screen.linux,
screen.mlterm,
screen.mlterm-256color,
screen.mrxvt,
screen.putty,
screen.putty-256color,
screen.rxvt,
screen.teraterm,
screen.vte,
screen.vte-256color,
screen.xterm-256color,
screen.xterm-new,
screen.xterm-r6,
screen.xterm-xfree86.
Once you've setup things to use the terminal database, there's no need for special/magic configuration files of your own. Besides, how would you tell the server which file to use? The real information is on your client, where you know which terminal emulator you are actually using.
zsh lets you use this information directly with the $terminfo array.
Further reading:
Why not just use TERM set to "xterm"?
Keybindings (see discussion of $terminfo[])
| How to setup zkbd (zsh keyboard bindings) in a server? |
1,536,681,940,000 |
Having read http://www.freedesktop.org/wiki/Software/libinput/ which states
libinput is a library to handle input devices in Wayland compositors
and to provide a generic X.Org input driver. It provides device
detection, device handling, input device event processing and
abstraction so minimize the amount of custom input code compositors
need to provide the common set of functionality that users expect.
I am confused. I very much hope that the above means libinput is something new, which should mean that nothing of this horrible keyboard layout settings related to X.Org will be carried over to X.Org.
I am confused by the mentioning of X.Org as "X.Org input driver"?
Does this mean rather
a) that the something from X.Org, i.e. an input driver, is brought to Wayland or
b) that Wayland (or libinput) will provide some backward support, so that it would be able to forward input events to a X.Org server running as a client inside of Wayland?
A good way to know this, would be to know how keyboard layouts are implemented in Wayland (I hope very much not as overly complicated as in X.Org)
Disclaimer/Update:
Since there was a down-vote. This question should not imply that "being related to X.Org server" is negative. It should simply help out to understand where to put this library.
|
Yes, libinput is something new that started as a part of the wayland project to be used instead of the x11 input drivers (like xorg-evdev and xorg-synaptics and xorg-wacom and so on and so forth).
In answer to your a/b scenario, it would be b, that is that libinput is not dependent on wayland and thus can run on other display servers (like X or Mir) as well.
| Is (wayland's) libinput something new, i.e., not related to X.Org server? |
1,536,681,940,000 |
I have read that some USB devices emulate a keyboard and the information these devices send will be as if the information was typed on a keyboard. For example: a magnetic card reader can use an emulated keyboard to give information about the card.
This is a question I had asked about keyboard, BT keyboard and stdin which explains how they work.
So where does an application have to listen to the input generated by an emulated keyboard?
|
If you hook up two USB keyboards to your system, or a USB keyboard to a laptop with built-in keyboard, you can alternately type characters¹ on each one (or use the left on one keyboard and the right on the other. The emulating devices have nothing more to do than tell the system they are a keyboard, just like a keyboard would do and characters coming from the device will be inserted in the right queue. The application just listens like it would for normal keyboard input.
There are other ways to get the same result, I used to have a barcode scanner from before the USB era, that had to be physically inserted between the keyboard and the mainboard (using female and male PS/2 connectors), one scan would act as if you pressed the number sequence of the barcode in quick succession.
¹ Special keys like Fn modify the keycode of other keys sent by the keyboard, so you cannot press Fn on one keyboard and expect the key on the other keyboard to be modified.
| How does an emulated keyboard work? |
1,536,681,940,000 |
I am running a database server on my computer. Sometimes it takes up so much memory resources that the system stop responding to keyboard and mouse inputs. Although I can move the mouse pointer and turn on and off Caps Lock, I can't do anything else beyond that.
Surprisingly, I am able to SSH to the computer, run the top command, kill a few processes and shutdown the database server to reclaim memory space. But even having done those things, the display remains in a semi-frozen state (mouse still animated).
Having reclaimed most of my memory, is it possible to regain usage of the system without having to reboot?
|
Freeing up resources should generally return the system to a normal functioning state, so it sounds to me like the system is still struggling to free up resources or, hasn't fully followed through on killing these processes. I'd investigate it further to find out if that's in fact the case. You can see, for example, if something is still writing data to the HDD. There are several tools that can assist with this, I'd start with fatrace to see if you can identify a process that's trying to finish up writing data to the disk.
Example
$ sudo fatrace | head -10
chrome(29486): W /home/saml/.config/google-chrome/Default/Extension State/017912.log
chrome(29486): CW /home/saml/.config/google-chrome/Default/File System/000/p/.usage
chrome(29486): W /home/saml/.config/google-chrome/Default/Extension State/017912.log
chrome(29486): W /home/saml/.config/google-chrome/Default/Extension State/017912.log
chrome(29486): W /home/saml/.config/google-chrome/Default/History-journal
chrome(29486): W /home/saml/.config/google-chrome/Default/History
chrome(29486): W /home/saml/.config/google-chrome/Default/History
chrome(29486): W /home/saml/.config/google-chrome/Default/History
chrome(29486): W /home/saml/.config/google-chrome/Default/History-journal
chrome(29486): W /home/saml/.config/google-chrome/Default/Extension State/017912.log
You'll want to run that command without the | head -10, that's just to show you the example here.
So what's wrong?
If you've ever looked at the output of free you've likely noticed the columns buffers and cache.
$ free
total used free shared buffers cached
Mem: 7969084 6673652 1295432 0 118588 893916
-/+ buffers/cache: 5661148 2307936
Swap: 8011772 3104804 4906968
These are files that the system is aggressively loading into memory to maximize performance by using as much RAM as it can for this task. When the DB process (or which ever ones is consuming RAM) these files were pushed to swap (I'm assuming) and now cannot come back in since this other task is occupying the HDD's I/O.
What can be done to mitigate this?
One trick is to adjust the VM dirty ratio & VM dirty background ratio, which forces the system to start writing dirty pages of memory out to disk. This activity is often times what's causing a system to seemingly hang, especially in the UI. There are other reasons but this is one of the more frequented ones.
excerpt
By default the VM dirty ratio is set to 20% and the background dirty ratio is set to 10%. This means that when 10% of memory is filled with dirty pages (cached data which has to be flushed to disk), the kernel will start writing out the data to disk into the background, without interrupting processes. If the amount of dirty pages raises up to 20%, processes will be forced to write out data to disk and cannot continue other work before they have done so.
Here's how you can check on your system's current settings:
$ sudo sysctl -a | grep 'dirty.*ratio'
vm.dirty_background_ratio = 10
vm.dirty_ratio = 20
To override these settings you can create the following file, /etc/sysctl.d/dirty_ratio.conf with the following content:
vm.dirty_ratio = 10
vm.dirty_background_ratio = 5
This will cause your system to be more aggressive about writing changes out as the occur. You can activate these changes immediately like so:
$ sudo sysctl -p /etc/sysctl.d/dirty_ratio.conf
Will this resolve the issue?
In my experience you can tweak these values but the true issue is your system is likely just not up to the task(s) you're asking it to perform.
References
LINUX PERFORMANCE IMPROVEMENTS
| How to regain control of my computer? |
1,536,681,940,000 |
I powered on my laptop running Debian kernel 3.3.0. After the boot process starts the X server and KDE, my keyboard and mouse do not function. Keyboard input works when I use the Recovery Console, and both the keyboard and mouse work when I boot into Windows. I've tried booting into Recovery Mode, and then into KDE, but it still doesn't show that I'm typing or that I'm moving the mouse.
I have also tried booting the previous 3.2.0.2 kernel, but both keyboard and mouse fail to receive input and do not respond.
EDIT: I logged into the recovery mode, and was able to get /var/log/Xorg.0.log. /etc/X11/xorg.conf did not exist.
/var/log/Xorg.0.log: http://pastebin.ca/2149488
EDIT 2: I tested to see if an external wired USB mouse and keyboard would work, but neither worked. I'm guessing it's an input problem with the X server, rather than just my keyboard and mouse inside the laptop.
EDIT 3: I tested two things: to see if the mouse is working at all in linux, and if other display managers would work. I ran cat /dev/input/mouse0 and ran my finger on the touchpad, and it displayed random stuff, so I can verify that the touchpad works.
I installed and tested both gnome, gdm3, and lxde, startlxde, but neither worked. Both did not let me move my mouse and did not let me type.
EDIT 4: Still trying... I purged xorg and xserver-xorg using apt-get purge xorg xserver-xorg and ran apt-get autoremove to get rid of the various xserver installs. Then I reinstalled both xorg and xserver-xorg and ran /etc/init.d/kdm start but the same problem happened.
So I just tried to start a simple X server display after restarting the computer. I went into maintenance mode, and ran xinit. When the terminal popped up, I could not type and had to force the computer to reboot. So I am guessing it is some configuration for the X server. I don't have Xorg.conf... are there any other configurations for X server?
EDIT 5: I got something working! I ran startx and then plugged in an external mouse, and I finally got the mouse cursor to move around. However, I could not get the keyboard to type or the touchpad on the laptop to actually do anything. So it looks like it just doesn't recognize both my keyboard and mouse on the laptop itself. Is there a way to configure the X server to accept input from more inputs, such as the keyboard and internal mouse?
|
Unfortunately I could not find a solution to fix the X server and allow me to use the mouse. I downloaded a live CD of Debian KDE and my mouse and keyboard worked, so it was a configuration that got messed up.
I ultimately reinstalled the core operating system. I had my data (/home,/usr, etc.) in separate partitions so I just had to reinstall /.
| Keyboard and mouse do not function in Debian |
1,536,681,940,000 |
My problem is I have an embedded system normally headless.
It has a serial console I use for debugging, but will not be present in production.
It has no vga/graphics/monitor/whatever.
It doesn't have a proper keyboard or mouse.
So far, so good.
Now I need to connect a barcode scanner that works in "keyboard emulation" (i.e.: presents itself as an USB keyboard and acts accordingly).
I enabled several device drivers as modules:
usbhid
evdev
hid_generic
hid
input_core
Scanner somehow works, meaning it gets initialized and generates Key events I can get reading /dev/input/event0 (and they look OK).
What I'm missing is the complete decoding so that I can open a device and read characters (not scancodes). I expected the hid-generic module to pick up input_events and generate characters to console.
What am I missing?
|
It turns out I have all I need.
Problem is keystrokes will not be sent to /dev/console (connected to serial line); they are however correctly decoded and available reading /dev/tt0 (current virtual terminal).
I have no idea (and neither interest, truly) if and how to redirect them to /dev/console so they get merged together as it happens on a desktop PC.
| What device drivers are needed to fully recognize a USB Keyboard? |
1,536,681,940,000 |
I have compose key set up on my openSUSE Tumbleweed (KDE) to map <apostrophe> + <c> to "ć" (U0107). I keep the rules in ~/.XCompose and all the programs respect them (e.g. Kate, Terminal, IntelliJ, etc), except Firefox. It keeps mapping apostrophe+c to ç. I have tried replacing all the ç's with ć's in .XCompose, but still somehow ç appears. Where does Firefox read config from and how to make it work properly?
|
It is, not so surprisingly, not a Firefox-specific problem, but rather GTK-wide (so others, such as LibreOffice, are impacted too). GTK doesn't handle input methods as one would expect, needing a separate config.
First, I needed to figure out which input method is used. gtk-query-immodules-2.0 and gtk-query-immodules-3.0 don't come with gtk2-tools and gtk3-tools which are installed by default, but require 32-bit versions, even on 64-bit systems (gtk2-tools-32bit and gtk3-tools-32bit). After installing the tools, running the query command revealed xim is not on the list of installed input methods, and I needed to install gtk2-immodule-xim, gtk3-immodule-xim and the 32-bit versions.
After making sure xim exists, the final step is to set GTK_IM_MODULE=xim and to export it in ~/.profile (somewhat strangely, even if one deletes cedilla.so from /usr/lib/gtk-*.0/[version]/immodules, it still continues to use cedillas).
| GTK apps don't respect compose key mappings |
1,536,681,940,000 |
I'm having some trouble pressing the ` key (I had to copy/paste it here) on my Ubuntu.
It acts like a weird tab or Esc now.
When checking with xkbevd, I get
^[
How can I reset this and get the key back?
Is there a way to see what's grabbing the event?
This is what it looks like in keyboard layout:
How can I unmap 'escape' from this key?
xev shows:
pressing backtick (no ctrl, no shift, just the key):
KeyPress event, serial 36, synthetic NO, window 0x3000001,
root 0xc0, subw 0x0, time 41199509, (277,668), root:(314,767),
state 0x0, keycode 49 (keysym 0xff1b, Escape), same_screen YES,
XKeysymToKeycode returns keycode: 9
XLookupString gives 1 bytes: (1b) ""
XmbLookupString gives 1 bytes: (1b) ""
XFilterEvent returns: False
KeyRelease event, serial 36, synthetic NO, window 0x3000001,
root 0xc0, subw 0x0, time 41199559, (277,668), root:(314,767),
state 0x0, keycode 49 (keysym 0xff1b, Escape), same_screen YES,
XKeysymToKeycode returns keycode: 9
XLookupString gives 1 bytes: (1b) ""
XFilterEvent returns: False
Pressing esc
KeyPress event, serial 36, synthetic NO, window 0x3000001,
root 0xc0, subw 0x0, time 41201255, (277,668), root:(314,767),
state 0x0, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
XLookupString gives 1 bytes: (1b) ""
XmbLookupString gives 1 bytes: (1b) ""
XFilterEvent returns: False
KeyRelease event, serial 36, synthetic NO, window 0x3000001,
root 0xc0, subw 0x0, time 41201320, (277,668), root:(314,767),
state 0x0, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
XLookupString gives 1 bytes: (1b) ""
XFilterEvent returns: False
|
You can change the action associated with a key using xmodmap. In your case, you want:
xmodmap -e 'keycode 49=grave asciitilde'
That sets the key with the keycode 49 to print a grave accent, a backtick, and a tilde when combined with shift. See this answer for a few more details.
| Key used in shortcut. How to unmap? |
1,536,681,940,000 |
Alright, I'm not really sure what's going on here. My laptop is a Dell precision m4800 running Ubuntu 15.04 64bit. It boots fast, without any issues, and I am able to login and generally go about my business. The problem come when I try to log in to a virtual console, the login is flooded with "^[[26~" (no quotes), endlessly. To me, this indicated that a key (F14, I think is the key that escape code belongs to.) was being pressed down. So, back in my WM, I opened up a terminal emulator and ran evtest, checked each input device until I found one with a permanent keypress. This ended up being /dev/input/event4, "AT Translated Set 2 keyboard". Here is an excerpt:
Event: time 1435012752.408326, -------------- EV_SYN ------------
Event: time 1435012752.428534, type 4 (EV_MSC), code 4 (MSC_SCAN), value ae
Event: time 1435012752.428534, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 2
Event: time 1435012752.428534, -------------- EV_SYN ------------
Event: time 1435012752.546660, type 4 (EV_MSC), code 4 (MSC_SCAN), value ae
Event: time 1435012752.546660, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 2
...and so forth, endlessly. Now, I do not have a volumedown key anywhere on my computer/keyboard, so I am really confused. I removed my laptop keyboard while it was booted, and the events didn't stop. However, when I reboot without the keyboard, with an external keyboard plugged in, there is no flooding.
The only other odd thing going on is that my numlock light has been stuck on for the past week (since this flooding started happening), regardless of whether numlock is enabled. It has faded to less than half the brightness it was a week ago, and is half the brightness of the other keys on the media board (the media board is attached to the motherboard). I wonder if the media board.
Does anyone have any suggestions so far as to how to diagnose this or, more importantly, how to mitigate it so I can use the virtual consoles again? Also of interest here is that the volume down key is also being pressed in my windows partition.
|
This sounds like a hardware issue, since it is happening in both operating systems and you say that your numlock light is acting up as well.
Are you sure you don't have volume keys on your laptop? All pictures of your laptop that I've found would suggest that there are three in the top left where you say the media board is. If this is the case that daughterboard for the volume buttons and indicator lights is likely malfunctioning and needs to be replaced. Try disconnecting this board from the motherboard and booting either OS again, and if the key presses stop then it's definitely that board. If you're still under warranty have Dell fix it, otherwise you'll need to get it fixed elsewhere.
| TTY being flooded by button that doesn't exist being held down |
1,536,681,940,000 |
Yesterday I was fed up with being forced to type Caps+Backspace to erase character in Putty, because a Backspace was printing a ~.
I found some info on internet saying you should type stty erase ~, or at least that how I understand it.
Since then when I type on / it send a ← to the terminal and I'm not even capable to copy/paste in my putty.
Does anyone has a good idea to save me ?
Note:
/ is still working in binary like vi or more but not in bash (where I typed the command).
Additional info:
bash-3.2# stty -a
speed 38400 baud; 55 rows; 210 columns
eucw 1:1:0:0, scrw 1:1:0:0:
intr = ^C; quit = ^\; erase = /; kill = ^U; eof = ^D; eol = <undef>
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; dsusp = ^Y; reprint = ^R
discard = ^O; werase = ^W; lnext = ^V
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -parext
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff -imaxbel
isig icanon -xcase echo -echoe -echok -echonl -noflsh
-tostop -echoctl -echoprt -echoke -flusho -pending -iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3
Edit 2:
Also stty -g provide a string usable by other stty so if you have a working command elsewhere you can export the result of one to import it to the buggy one.
|
An unquoted ~ expands to /path/to/your/home/dir in most shells.
The stty man page doesn't say what it does when the argument to erase is something other than a single character or undef or ^ followed by a character, but it looks like your stty uses the first character of the argument string.
Type stty erase '~' (with the single quotes). It's good practice to always quote the argument, because some shells treat ^ as the pipe symbol.
| Since I execute 'stty erase ~' I can't type / anymore in Putty |
1,536,681,940,000 |
I just installed Debian 6.0, encrypted / and now I'm trying to boot. When GRUB comes up, I select Debian, it loads the initrd and asks for the root password, however I can't enter anything, because the system doesn't recognize my keyboard. It is a standard USB keyboard. What can I do to get my keyboard working?
|
Either add the following into the /etc/initramfs-tools/modules:
usbcore
uhci_hcd
ehci_hcd
usbhid
or change the module policy to most in /etc/initramfs-tools/initramfs.conf:
MODULES=most
After this, repack the initramfs with the command:
update-initramfs -u
| Getting keyboard to work in debian 6.0 in order to unlock root partition |
1,536,681,940,000 |
For the record, the same problem happens in openSUSE, too, and the solution is the same. It is fixed in both Fedora 18 (as far as I could tell: I just booted a live CD) and openSUSE 12.3.
I installed Fedora 17 on my laptop, where I use a keyboard (Logitech K120) and mouse (generic USB mouse) connected to a hub.
Then I noticed that neither the keyboard nor the mouse worked. However:
They do work in Arch Linux, Windows, GRUB and on the console (they only die when X starts), regardless if they're connected to a hub or not.
If I plug the mouse/keyboard directly into the USB ports, they work properly.
This shows that neither the USB hub nor the keyboard/mouse are damaged.
lsusb of the relevant devices (USB hub, keyboard and mouse, respectively):
Bus 002 Device 004: ID 058f:6254 Alcor Micro Corp. USB Hub
Bus 002 Device 006: ID 046d:c31c Logitech, Inc. Keyboard K120 for Business
Bus 002 Device 005: ID 093a:2521 Pixart Imaging, Inc.
Any clues?
Editing as per sch's comments:
The keyboard works on the console.
The keyboard/mouse appears on xinput list, only when they're connected directly to the USB ports; not when they are connected to the hub.
There is a change in /proc/interrupts when I move the mouse, even though the cursor doesn't move.
When I plug the mouse/keyboard through the hub, nothing happens in the X logs. When I plug them directly I get the standard log information:
[ 407.686] (II) config/udev: Adding input device USB OPTICAL MOUSE (/dev/input/mouse1)
[ 407.686] (II) No input driver specified, ignoring this device.
[ 407.686] (II) This device may have been added with another device file.
[ 407.686] (II) config/udev: Adding input device USB OPTICAL MOUSE (/dev/input/event8)
[ 407.686] (**) USB OPTICAL MOUSE: Applying InputClass "evdev pointer catchall"
[ 407.686] (II) Using input driver 'evdev' for 'USB OPTICAL MOUSE'
[ 407.686] Option "XkbRules" "evdev"
[ 407.686] Option "XkbModel" "evdev"
[ 407.686] Option "XkbLayout" "us"
[ 407.686] Option "_source" "server/udev"
[ 407.686] Option "name" "USB OPTICAL MOUSE"
[ 407.686] Option "path" "/dev/input/event8"
[ 407.686] Option "device" "/dev/input/event8"
[ 407.686] Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb3/3-2/3-2:1.0/input/input30/event8"
[ 407.686] Option "driver" "evdev"
[ 407.686] (**) USB OPTICAL MOUSE: always reports core events
[ 407.686] (**) evdev: USB OPTICAL MOUSE: Device: "/dev/input/event8"
[ 407.686] (--) evdev: USB OPTICAL MOUSE: Vendor 0x93a Product 0x2521
[ 407.686] (--) evdev: USB OPTICAL MOUSE: Found 9 mouse buttons
[ 407.686] (--) evdev: USB OPTICAL MOUSE: Found scroll wheel(s)
[ 407.686] (--) evdev: USB OPTICAL MOUSE: Found relative axes
[ 407.686] (--) evdev: USB OPTICAL MOUSE: Found x and y relative axes
[ 407.686] (II) evdev: USB OPTICAL MOUSE: Configuring as mouse
[ 407.686] (II) evdev: USB OPTICAL MOUSE: Adding scrollwheel support
[ 407.686] (**) evdev: USB OPTICAL MOUSE: YAxisMapping: buttons 4 and 5
[ 407.686] (**) evdev: USB OPTICAL MOUSE: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 407.687] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb3/3-2/3-2:1.0/input/input30/event8"
[ 407.687] (II) XINPUT: Adding extended input device "USB OPTICAL MOUSE" (type: MOUSE, id 17)
[ 407.687] (II) evdev: USB OPTICAL MOUSE: initialized for relative axes.
[ 407.687] (**) USB OPTICAL MOUSE: (accel) keeping acceleration scheme 1
[ 407.687] (**) USB OPTICAL MOUSE: (accel) acceleration profile 0
[ 407.687] (**) USB OPTICAL MOUSE: (accel) acceleration factor: 2.000
[ 407.687] (**) USB OPTICAL MOUSE: (accel) acceleration threshold: 4
|
It is a known bug in Fedora 17. The /lib/udev/rules.d/71-seat.rules has a rule for a "Mimo 720" device (an USB monitor with its own USB hub) which uses the same chipset (thus the same USB ID) for this task.
However, because I am not using a Mimo 720, it gets misconfigured.
Solution is editing /lib/udev/rules.d/71-seat.rules and commenting the line
SUBSYSTEM=="usb", ATTR{idVendor}=="058f", ATTR{idProduct}=="6254", ENV{ID_AUTOSEAT}="1"
Then it works perfectly. In fact, checked on Arch Linux and it uses a different strategy to detect that device:
# Mimo 720, with integrated USB hub, displaylink graphics, and e2i
# touchscreen. This device carries no proper VID/PID in the USB hub,
# but it does carry good ID data in the graphics component, hence we
# check it from the parent. There's a bit of a race here however,
# given that the child devices might not exist yet at the time this
# rule is executed. To work around this we'll trigger the parent from
# the child if we notice that the parent wasn't recognized yet.
| Keyboard/mouse do not work when connected to USB hub, but only on Fedora - works on other distros |
1,536,681,940,000 |
I'm driving a Debian testing machine that is running fine. But since testing includes Linux Kernel 3 I have the following problem:
While booting all is working (I mean especially the keyboard) - controlled by switching NumLock state. The moment gdm3 starts (from init) the keyboard dies... It can only be reanimated by killing gdm3 (I do this via ssh). Running startx from console behaves fine, thus the "xorg.conf" seems to be fine.
The output from startx reads as
X.Org X Server 1.10.3
Release Date: 2011-07-08
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.0.0-rc6-amd64 x86_64 Debian
Current Operating System: Linux sobolev 3.0.0-1-amd64 #1 SMP Sun Jul 24 02:24:44 UTC 2011 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.0.0-1-amd64 root=UUID=7d005ab3-c823-4cc9-b70a-9316a5eab8d6 ro quiet
Build Date: 07 August 2011 06:45:11PM
xorg-server 2:1.10.3-1 (Cyril Brulebois <[email protected]>)
Current version of pixman: 0.22.2
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Fri Aug 26 09:19:48 2011
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(II) [KMS] Kernel modesetting enabled.
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning: Type "ONE_LEVEL" has 1 levels, but <RALT> has 2 symbols
> Ignoring extra symbols
Errors from xkbcomp are not fatal to the X server
Any ideas? I'm using a PS/2 keyboard and USB mouse. The mouse is alive under gdm3.
|
This happens typically when you upgrade your Xorg server without upgrading/re-installing the xorg keyboard drivers afterwards. This is contained in a separate package - on Gentoo it is xf86-input-keyboard, on Debian (according to Gilles' comment below) the name should be xserver-xorg-input-kbd . Try upgrading/re-installing it.
Edit : Merged the package name information from Gilles' comment.
| Keyboard Problem with Debian testing and gdm3 |
1,536,681,940,000 |
I have a Lenovo Duet 3 Bluetooth keyboard, which works fine when connected physically (it has 5 pins for that) to its laptop, and also works as expected when I connect it to my Android phone.
However, I cannot get it to work under (Arch) Linux. Kernel and bluetooth stack (bluez-libs etc.) are up to date, so I connect the device using bluetoothctl (output abbreviated for clarity):
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# scan on
Discovery started
[NEW] Device D6:45:02:72:41:4F Duet 3 BT
[bluetooth]# pair D6:45:02:72:41:4F
Attempting to pair with D6:45:02:72:41:4F
[CHG] Device D6:45:02:72:41:4F Connected: yes
[CHG] Device D6:45:02:72:41:4F ServicesResolved: yes
[CHG] Device D6:45:02:72:41:4F Paired: yes
[NEW] Primary Service (Handle 0x0000)
/org/bluez/hci0/dev_D6_45_02_72_41_4F/service000a
00001801-0000-1000-8000-00805f9b34fb
Generic Attribute Profile
... {more new services follow, e.g. for Dev. Information, Battery etc.}
Pairing successful
[Duet 3 BT]# trust D6:45:02:72:41:4F
Changing D6:45:02:72:41:4F trust succeeded
[Duet 3 BT]# connect D6:45:02:72:41:4F
Attempting to connect to D6:45:02:72:41:4F
Connection successful
[Lenovo Duet 3 BT Folio]#
The device stays connected, and I can see battery information. So far, so good, but typing anything or using the trackpad does absolutely nothing, so it's pretty useless as an input device.
|
Try to turn on Caps Lock before you detach the keyboard.
| Bluetooth keyboard connects, but does not work |
1,536,681,940,000 |
Out of nowhere, the left Windows/Meta key on my Corsair K70 RGB MK.2 just stopped working on my Manjaro KDE Plasma system.
The right one still works fine, opening the application launcher as it should.
It also gets recognized by shortcut assignment as the “Meta” key.
The left one, however, doesn’t get recognized by anything anymore. It does send a signal, but in the Application Launcher Configuration it just looks… weird:
(Note the garbled "name")
And setting it like that still won’t trigger the application launcher. It is as if the keyboard is just sending nonsense on that key all of a sudden.
Apps like https://keyboard-test.space/ or https://www.keyboardtester.com/ don’t recognize it, either, showing either “unrecognized” or nothing at all.
Obviously, I thought maybe the keyboard went kaputt, but I tried two other keyboards and those show the exact same behavior: Right Meta key works fine, left one not at all.
Therefore I strongly suspect something in the system being the cause of this.
It can also not be related to any update, as none were installed in between it working fine and now being broken.
I have no idea how to even debug this problem further, so I'd be thankful for any ideas.
|
I found a solution that worked for me:
Going from Settings:
-> Hardware section: Input Devices
-> Advanced tab
-> Position of Compose key
-> Turn off "Left Win" -> Apply.
It may require a restart.
I can't remember having ever set this option, so possibly it was accidentally set during an update, through a misconfiguration in that update.
| Left Windows/Meta key suddenly stopped working |
1,536,681,940,000 |
I'm working on a platform with Wayland & Weston and I so far only have the Wayland-Terminal application installed. I can start it but it's unusable because I cannot type a single letter, it constantly gets repeated many times. It appears as if the keyboard repeat delay is set way too low. According to http://manpages.ubuntu.com/manpages/bionic/man5/weston.ini.5.html#keyboard%20section I have added a [keyboard] section to /etc/xdg/weston/weston.ini and it now looks like:
[core]
idle-time=0
require-input=false
repaint-window=17
[keyboard]
repeat-rate=50
repeat-delay=500
but after a reboot, the keyboard remains unusable, there does not seem to be any change at all. Anyone that can assist in this matter?
Thank you!
|
I was able to come to a usable keyboard configuration with the following values (which I know are far from optimal but are good enough for me for now):
[core]
idle-time=0
require-input=false
repaint-window=17
[keyboard]
repeat-rate=0
repeat-delay=500
| How to set keyboard repeat delay in Weston |
1,581,358,936,000 |
I added the following to /usr/share/X11/xkb/symbols/us:
key <AC06> { [ h, H, Left ] };
key <AC07> { [ j, J, Down ] };
key <AC08> { [ k, K, Up ] };
key <AC09> { [ l, L, Right ] };
key <AD08> { [ i, I, Home, Home ] };
key <AB08> { [ comma, less, End, End ] };
key <CAPS> { [ ISO_Level3_Shift ] };
Because arrow keys and Home/End keys are just too goddamn away. The problem is, these modifications get ignored in some programs.
They work well in browers and some text editors like vscode and emacs gui, while they do not in Sublime Text and Konsole (KDE Terminal) for example.
Is there a fix. I'm using Fedora if that matters.
|
I just hacked together the following solution. It not only works in Sublime Text, but also allows to select text with shift.
Add preserve[Shift+LevelThree] = Shift; to …/xdb/types/iso9995. Details on askubuntu.
Add type="THREE_LEVEL" and actions[Group1]= [NoAction(), NoAction(), RedirectKey(keycode=<UP>, clearmods=Lock) (for up) to your entries in /usr/share/X11/xkb/symbols/us.
My entries with slightly different keys looks like this:
key <AD07> { type="THREE_LEVEL",
symbols[Group1]= [ u, U, Home, Home ],
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(keycode=<HOME>, clearmods=Lock) ]
};
key <AD08> { type="THREE_LEVEL",
symbols[Group1]= [ i, I, Up, Up ],
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(keycode=<UP>, clearmods=Lock) ]
};
key <AD09> { type="THREE_LEVEL",
symbols[Group1]= [ o, O, End, End ],
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(keycode=<END>, clearmods=Lock) ]
};
key <AC07> { type="THREE_LEVEL",
symbols[Group1]= [ j, J, Left, Left ],
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(keycode=<LEFT>, clearmods=Lock) ]
};
key <AC08> { type="THREE_LEVEL",
symbols[Group1]= [ k, l, Down, Down ],
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(keycode=<DOWN>, clearmods=Lock) ]
};
key <AC09> { type="THREE_LEVEL",
symbols[Group1]= [ l, L, Right, Right ],
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(keycode=<RGHT>, clearmods=Lock) ]
};
Read this article on the Archlinux Wiki for more details.
Maybe you can skip 1. and the type declaration if you don't want to select text with shift.
| XKB - configurations not working properly |
1,581,358,936,000 |
I'm not so new to Linux in general, but I am new to Arch.
I've installed it twice (the first time on an HDD, just to try while waiting for the SSD to be delivered to me, the second time, a few days after, on the SSD), with i3 and other programs in order to have a usable desktop environment. By the way, my choices were based on the match between my taste (Vim-addicted) and pure readings of the official Arch wiki pages.
At the moment there's one thing that is annoying me tremendously: when I open Spotify (installed from AUR, trough aurman -S) or Qutebrowser (official, through sudo pacman -S) and, possibly, other applications, either from the terminal urxvt or through rofi, I experience a complete "freeze" of the keyboard which lasts for as long as fifty seconds (!), while the mouse still interacts perfectly with the environment. For instance, I can do this funny thing:
Open Spotify, then
Keep doing anything on the keyboard with the left hand, e.g.
keep pressing 1 and 2 alternatively and frenetically with a finger while holding down $mod, which is Alt in my case, with the thumb,
or randomly press letter keys while in a text box in the browser or in the innocent terminal
or, just to be clear about what I've tried, pressing my angry cat on the whole keyboard
In the meanwhile, use the right hand to successfully move from one workspace to another with the mouse (using the numbered icons in the bottom-left part of the screen), and interact with any mouse-interactive stuff (next song, raise volume, change audio output in pavucontrol, ...). Obviously, should I move to a workspace with a full-screened program, I would be stuck in that workspace until those long fifty (more or less) seconds pass by.
The keyboard starts working again and it is as I never pressed those keys (e.g. if I was pressing letters while in the terminal, those "past" letters do not appear).
The keyboard is a wireless Logitech K270 (with the wireless M185 mouse from the same box) with a USB receiver, but I honestly don't know what other details I could provide, so please ask me. (I don't really think that the filesystem could play any role in the matter but, should I be wrong, it's btrfs.)
My motherboard is a X399 Aorus Gaming 7, and has
1 x white USB 3.1 Gen 1 Port (from the user's manual, while it's labeled as USB 3.0 BIOS on the I/O shield, since it's the Q-Flash port aimed at flashing the BIOS)
5 x blue USB 3.1 Gen 1 Ports (from the user's manual, while they're labeled as USB 3.0 on the I/O shield)
2 x yellow USB 3.1 Gen 1 Ports (from the user's manual, while it's labeled as USB 3.0 DAC-UP on the I/O shield)
1 x red USB 3.1 Gen 2 Type-A Port (from the user's manual, while it's labeled as USB 3.1 on the I/O shield)
The 9 ports are disposed in couples as in (letters = colors)
YY
WB
BB
BB
R
|
I'm posting this self-answer since it represented a solution for me, so far, and could help someone else who is looking for answers without paying enough attention to the question, but I'll wait for some guru to give an explanation to this strange problem.
After having connected a wired PS/2 port keyboard and verified it's not affected by this problem, I tried moving the receiver from lower-left-most blue USB port to the red one. This worked. Then I checked the keyboard package for some info about USB, but not even a dotten number like 2.0, 3.0, or whatever was on there, so I just kept trying. The white port, then the yellow ones, and other blue ports. The keyboard works perfectly with every single USB port except that one, the first I tried.
| keyboard freezes after opening program, mouse keeps working |
1,581,358,936,000 |
I use a tiling window manager (xMonad at the moment), and due to this I need a key that acts as the ‘control key’ for window management. Whenever I use a keyboard with Windows/Super/Mod4 keys, I use the left Windows key as that key, while my right Windows key acts as Compose/Multi_key.
However, I also have a couple of ([very] old) keyboards that don't have any Windows keys (i.e. they're winkeyless), and there I don't have any key left that I can (comfortably) use as my ‘WM control key’. In the past, because xMonad allowed that, I used Control+Alt as my ‘WM control key (combination)’, but as I noticed after some time, this interferes with (some) Emacs (movement commands), so this isn't an option anymore. Therefore, I thought that I could utilise my Escape key in the following way:
If I hold down Ecs, it acts like Mod4
If I tap Esc, it acts as Escape
AFAIK, holding down Escape doesn't really do anything normally, so I thought it might be a good idea to do it like this. I then tried to achieve this by using xmodmap:
clear Mod4
add Mod4 = Super_L Escape
What I expected: Super_L still acts as Super, and Escape is now an additional Super. The next step would have been to use xcape to get (some) of the old Escape key behaviour back.
What I got (the output of xmodmap):
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Meta_L (0xcd)
mod2 Num_Lock (0x4d), Hyper_L (0xcf)
mod3 Scroll_Lock (0x4e), Mode_switch (0xcb)
mod4 Escape (0x9), y (0x34), Super_L (0x85), Super_L (0xce)
mod5 ISO_Level3_Shift (0x5c)
What I don't understand:
Why is y suddenly set to Mod4, as well?
Why does Escape still work as Escape (when pressed once) and Super (when held down; I noticed this when I tried to test my changes), although at this point I had not used xcape yet.
Is this a bug in xmodmap, or am I using xmodmap incorrectly? I suspect it's the latter, but could somebody help me with achieving what I'm trying to do?
Further info (hopefully not irrelevant):
My current OS is Arch Linux
I'm open to solutions that use other software, such as xkb, xdotool, etc.
I'm currently using the German QWERTZ layout (i.e. ISO, not ANSI), and sometimes Neo (which, AFAIK is implemented as another variant of the de keymap/layout; see output of localectl below)
I want my solution to work keyboard/hardware independent: If I change my keyboard, I don't want to have to change any config files.
Before anyone suggests this: Mapping Super to Capslock is not an option, as I sometimes use the Neo layout, which uses Capslock as one of its 3rd layer modifiers, and it's also used for the 5th and 6th layer. This also means that I'd like this solution to be keyboard layout independent, as well, so I can easily switch between, e.g. Neo and QWERTZ.
I'm still open to other suggestions. My only demands: No/minimal interference with any other programs (e.g. Emacs or Vim), and the key (combination) to use as my ‘WM control key’ should be located on the left side of my keyboard, because most of the other keys I use to control my WM are on the right side of my keyboard (e.g. h, j, k, l,…).
Before any changes, i.e. my current situation, xmodmap outputs:
xmodmap: up to 2 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Meta_L (0xcd)
mod2 Num_Lock (0x4d), Hyper_L (0xcf)
mod3 Scroll_Lock (0x4e), Mode_switch (0xcb)
mod4 Super_L (0x85), Super_L (0xce)
mod5 ISO_Level3_Shift (0x5c)
My current .Xmodmap is:
add Mod3 = Scroll_Lock
And localectl says:
System Locale: LANG=de_DE.UTF-8
LC_COLLATE=C
VC Keymap: de-latin1-nodeadkeys
X11 Layout: de,de
X11 Model: pc105
X11 Variant: nodeadkeys,neo
X11 Options: compose:rwin,grp:ctrls_toggle
|
I use xcape for this. Map the key to Super_L in Xmodmap, and run xcape -e 'Super_L=Escape' when XMonad starts.
| Turning the Escape key into a modifier that still acts as Escape when tapped |
1,581,358,936,000 |
I'm trying to have my Raspberry Pi function as a GUIless music player. I've got Arch Linux installed, and use it through ssh. I've got also an IR receiver dongle, and I'm planning to use it to control the music volume, skip to the next song, play a random song etc.
The IR dongle identifies as a keyboard, and writes to /dev/input/event0. At first I tried to make it work with LIRC, but apparently IR dongles that pretend that they are keyboards don't function well with LIRC.
My question is that now that I've got some keyboard-like input from my IR receiver, how could I pipe that to the program? Currently I'm using cmus in screen.
If there is some kind of general advice how to make my setup work, I'll happily hear that. If not, at least I'd like to get some idea how to connect the IR-receiver-keyboard to a program running in screen.
Edit:
How stupid of me, why didn't I think of simply catting it in.
However, there's a bunch of problems:
First of all, cat /dev/input/event0 just outputs mumble jumble (looks like this, in UTF-8 terminal: �SS�xO��SS�xj��SS�x��SS�CO��SS�Cj��SS�C. One keypress might output half a row of this, and the longer you press, the longer the output.). It certainly responds every time I hit a button of my remote, but I'm not sure what encoding the bytes are in, are they just scancodes or what.
Secondly, I still want to control it from ssh, so I need input multiplexer.
Third, when I type the following:
cat /dev/input/event0 | screen -rd or cat /dev/input/event0 | screen cmus
it complains:
Must be connected to a terminal.
|
I am not sure I correctly understand your situation, but
cat /dev/input/event0 | someprogram
should make someprogram read from standard input, whatever is written to /dev/input/event0.
(May I ask how you where able to make the IR receiver write to a device file. That is something I failed to accomplish with my IR dongle.)
My general advice is to read from the file in a python script, and based on what character you have read, you can do something.
inputCharStream = open('/dev/input/event0')
while True:
c = inputCharStream.read(1)
if c=='a':
print "character a"
if c==chr(1):
print "byte 1 which is not printable"
break
Instead of printing nonsense, you can use some python library and do something useful.
| Connect a keyboard / IR controller to a command line program running in a screen |
1,581,358,936,000 |
Something weird is going on with my keyboard. The keyboard is a USB-connected Unicomp, which works absolutely flawlessly once the computer is up and running. However, GRUB 2 (specifically, 1.99-27+deb7u1 as shipped in Debian Wheezy) isn't quite so happy. The failure modes make this a little difficult to test, but here's what I've been able to deduce thus far:
The keyboard status LEDs flash during the POST, so the keyboard is detected (I also get a report "Detected: ... 1 Keyboard"); I've got maybe one "no keyboard detected" error from the POST, nowhere near enough to deduce any pattern to that, and I've been rebooting the system quite a few times in different ways lately
On a power on from a full power off with the front panel power button, everything seems to work great
On a reboot (either using reboot or Control+Alt+Delete in a booted system or in GRUB), the keyboard works in GRUB maybe every other time I try
If I hit the Reset button on the computer to reboot, the keyboard consistently does not work in GRUB when the boot loader comes back, and many times does not react to key presses during the POST either
What's even more weird is that I don't recall the computer acting like this before. I'm hoping it's unrelated, but it seems to have started acting up right around when I hooked up the UPS to some more things around my desk, instead of only having hooked it up to the computer and monitor. (No, the UPS is nowhere near overloaded; the load is reported as being in the range 7-20% depending on usage; around 15-16% of maximum load when the computer is up and running normally.)
I've Googled and found the suggestion to load the GRUB 2 modules uhci and usb_keyboard. I added a GRUB_PRELOAD_MODULES declaration specifying the two of them to /etc/default/grub and re-ran update-grub (there is now insmod uhci and insmod usb_keyboard in my /boot/grub/grub.cfg), but that does not seem to have changed anything.
I've moved the keyboard to another USB port, which does not appear to have helped. I would try an offboard USB controller if I had one handy.
BIOS/UEFI setup reports legacy USB support and legacy USB 3.0 support as enabled, and even if it didn't, I don't see why it would sometimes work and sometimes not, especially when many times the only difference between the two is which side of a warm reboot it's on.
The motherboard is an ASUS M5A97 Pro with UEFI version 1007 02/10/2012.
I can't think of any other configuration changes I've done that coincide with when the computer started acting up. The logs do mention an upgrade of linux-image on Aug 1, and that I reinstalled (it's noted as upgrade, but the from-version and to-version are identical) grub-pc on Aug 2, but both of those was a week before I even bought the UPS, and two weeks before I hooked it up to more than just the computer and monitor (I take care to not change too many things at once). uname -r reports 3.2.0-4-amd64.
I'm running out of ideas to try. How can I get my USB keyboard to work consistently in GRUB 2? What else can I check?
|
Well, I kinda-sorta found out what's wrong. I still don't know what's the underlying problem, though.
Upgrading the UEFI/BIOS to the most recent version (currently 1604) did not help, despite the fact that a few interim releases were specifically advertised as "enhance compatibility with some USB devices" (which appears to have been my exact problem). In fact, if anything, it seemed to make matters worse, but in a good way: the system started consistently failing to be able to use the keyboard on a warm reboot. Consistent errors are always easier to debug and fix.
By applying the scientific method (form a hyphothesis, figure out a way to test it, test and refine), I was able to determine that the most likely culprit is my USB mouse or more generally having a USB pointing device of mine connected.
I started out by disconnecting everything USB-connected that wasn't absolutely necessary to test the failure case, so the only peripheral which was on the USB bus was the keyboard. That worked. So I added things back, one at a time, testing as thoroughly as I could between each change. Things started acting up by the time I added the desk hub, to which I had hooked up two devices: my mouse and drawing tablet. After some back-and-forth, I unplugged both of those but left the hub connected; still had the same issues. Plugging only either the hub, the mouse or the tablet directly into the USB ports on the motherboard got me back to where I started, which meant that one or more of those were causing my problems.
I can do without the tablet, but using the computer with no pointing device gets rather tiresome really fast, so I dug around in my spare computer cables box and found a USB to PS/2 adapter which I thought I'd give a try. Having plugged the mouse into the adapter and the adapter into the PS/2 mouse/keyboard port on the motherboard, things seem to be working. I did as full a test as I could think of and each time the system came back completely normally.
My current working hypothesis is that something has caused damage to the USB hub which may have propagated to the tablet and mouse, and that this damage is somehow causing my problems. (The only two non-host devices I've had connected to the hub is the mouse and tablet.) That doesn't fully explain why connecting the mouse through a USB-PS/2 adapter seems to work just fine, but a guess is that it might have something to do with how the BIOS handles the different devices (it does not seem to recognize a "PS/2" mouse as a mouse, but I can certainly live without the mouse in the UEFI setup).
I'll be able to test this hypothesis further next week, assuming I can borrow a USB mouse from work.
For now, disconnecting the hub and tablet and having moved the mouse to the PS/2 port appears to be good enough.
| USB keyboard only works intermittently in GRUB 2 on reboots - how to make it work consistently? |
1,581,358,936,000 |
I am used to use ctrl+shift to change keyboard layout. I found how to do change keyboard layout :
However, I can't set crtl+shift, for example, I can set only ctrl+tab or ctrl+c or ctrl+shift+w etc but can't only ctrt+shift. How to do it?
|
Looks like you are running the Gnome Desktop Environment. If so, you can do this with the Tweak Tool. Search for and run the tweak tool, select Typing>Switching to another layout and tick the box for Ctrl+Shift.
| How to change keyboard layout shortcut to ctrl+shift on Debian 9? |
1,481,241,149,000 |
After Xorg starts, keyboard doesn't work. It's even impossible to change tty. I've extracted logs and it says
[ 14.990] (EE) Failed to load module "libinput" (loader failed, 7)
and
[ 14.989] (EE) Failed to load /usr/lib/xorg/modules/input/libinput_drv.so: /usr/lib/x86_64-linux-gnu/libinput.so.10: version `LIBINPUT_1.5' not found (required by /usr/lib/xorg/modules/input/libinput_drv.so)
Full log: http://pastebin.com/hze08rbG
How can I solve it using other linux or disabling Xorg someway?
|
Ok, So looking at the logs and the comments.Here is my first set of analysis,
You have two video cards,
Intel which is integrated video card
Nvidia 960M
Which is called as Optimus setup.
By default now you are switched to Nvidia driver which is somehow causing the problem.
To get rid off this problem first you should try not to boot till graphical.target.
Try not to boot till graphical.target
Go to recovery mode and get the root shell.
Remount the rootfs using mount -o remount,rw /
Enable multi-user.target which is not really required but kind of double check using systemctl enable multi-user.target --force
Set default target to multi user using systemctl set-default multi-user.target
Reboot the system.
So now you should get a login prompt and enter your login username and password.
Uninstall the Nvidia drivers
This is bit tricky, You need to identify the drivers which are installed. Some of the distribution provides drivers along with their release which is proprietary and tested. There are other third party drivers like Noveau. So,
Search for the available drivers which are in your repo using apt-cache search nvidia. I hope which should list some of the packages like nvidia-364 nvidia-304 nvidia-noveau.
If you are not sure about the one which you have installed then try uninstalling all. For example, If you are using nvidia-304 then sudo apt-get purge nvidia-304
Again kind of fail safe measurement, try reinstalling Xorg using sudo apt-get install --reinstall xorg.
Once you are done with all these steps, flush your buffer using sync and reboot. Again you will get the login prompt and just login and proceed for the next steps.
Switch back to graphical.target
In this phase try to switch back to graphical.target to test your luck ;)
Boot into recover mode.
Remount the rootfs mount -o remount,rw /
Switch to graphical.target using sudo systemctl set-default graphical.target
Flush the buffer using sync
Reboot the system.
That should bring your UI up along with all the input devices working.
Cheers!
| Keyboard doesn't work |
1,481,241,149,000 |
Once in a while I come across annoying web sites, which think they know security and won't allow me to paste password from password manager. I want a tool which allows me to take clipboard text and paste it into a web site. I know how to obtain contents of the clipboard (xclip), but how could I take that text and paste it in form of keystrokes?...
|
I did some digging, and it seems that pasting could be achieved using xdotool
Here is a script I wrote, which could then be bound to a keystroke:
#!/bin/bash
XCLIP=$(which xclip)
if [ "$XCLIP" == "" ]; then
echo "Need to install xclip"
exit 1
fi
XDOTOOL=$(which xdotool)
if [ "$XDOTOOL" == "" ]; then
echo "Need to install xdotool"
exit 1
fi
TEXT=$($XCLIP -out)
if [ "$TEXT" == "" ]; then
exit;
fi
ACTIVEWIN=$($XDOTOOL getactivewindow)
if [ "$ACTIVEWIN" == "" ]; then
exit;
fi
$XDOTOOL type --window $ACTIVEWIN "$TEXT"
| Paste clipboard as text into keyboard buffer |
1,481,241,149,000 |
I need to send keystrokes virtually to a terminal program (like vi or emacs).
I want to do something like this:
echo -e 'iHello, world!\e' | vi
and then have a vi session open with this buffer:
Hello, world!
~
~
~
~
~
But that does not work as vi does not read keystrokes through stdin.
I get this error:
ex/vi: Vi's standard input and output must be a terminal
How can I send some text string to a terminal program as if the string was typed directly on a keyboard?
|
That's typically what expect was written for:
expect -c 'spawn -noecho vi; send "iHello World!\r\33"; interact'
While expect was written for TCL in days prior to perl or python being popular, now similar modules for perl or python are also available.
Another option is to issue TIOCSTI ioctls to your tty device to insert characters (one byte at a time) in its input queue:
perl -le 'require "sys/ioctl.ph";
ioctl(STDIN, &TIOCSTI, $_) for split "", join " ", @ARGV
' $'iHello World!\r\e'; vi
That has the benefit of avoiding an extra pseudo-terminal layer in between your terminal emulator and the application (here vi).
| How do I emulate sending keystrokes through a terminal program? |
1,481,241,149,000 |
My trackpad works fine, but the moment I press a button on my keyboard, the mouse freeze and I can not use my trackpad anymore. When I release the key the trackpad works again. This is an issue for some software where I would like to continue using my keyboard while moving the mouse
I am on Ubuntu 20.04 on a DELL laptop
Output of xinput list-props for the touchpad id
Device 'DELL07E6:00 06CB:76AF Touchpad':
Device Enabled (172): 1
Coordinate Transformation Matrix (174): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Tapping Enabled (327): 1
libinput Tapping Enabled Default (328): 0
libinput Tapping Drag Enabled (329): 1
libinput Tapping Drag Enabled Default (330): 1
libinput Tapping Drag Lock Enabled (331): 0
libinput Tapping Drag Lock Enabled Default (332): 0
libinput Tapping Button Mapping Enabled (333): 1, 0
libinput Tapping Button Mapping Default (334): 1, 0
libinput Natural Scrolling Enabled (311): 1
libinput Natural Scrolling Enabled Default (312): 0
libinput Disable While Typing Enabled (335): 1
libinput Disable While Typing Enabled Default (336): 1
libinput Scroll Methods Available (313): 1, 1, 0
libinput Scroll Method Enabled (314): 1, 0, 0
libinput Scroll Method Enabled Default (315): 1, 0, 0
libinput Click Methods Available (337): 1, 1
libinput Click Method Enabled (338): 1, 0
libinput Click Method Enabled Default (339): 1, 0
libinput Middle Emulation Enabled (340): 0
libinput Middle Emulation Enabled Default (341): 0
libinput Accel Speed (318): 0.000000
libinput Accel Speed Default (319): 0.000000
libinput Left Handed Enabled (323): 0
libinput Left Handed Enabled Default (324): 0
libinput Send Events Modes Available (292): 1, 1
libinput Send Events Mode Enabled (293): 0, 0
libinput Send Events Mode Enabled Default (294): 0, 0
Device Node (295): "/dev/input/event10"
Device Product ID (296): 1739, 30383
libinput Drag Lock Buttons (325): <no items>
libinput Horizontal Scroll Enabled (326): 1
|
Run xinput and note down the touch- or trackpad ID.
Execute
xinput set-prop <id> 'libinput Disable While Typing Enabled' 0
Or, as you did, list its properties with xinput list-props <id>, note down the property number of the "Disable While Typing Enabled"
line (in your case 335) and execute
xinput set-prop <id> <property> 0
| Cannot use trackpad and keyboard at the same time |
1,481,241,149,000 |
I would like to disable the insert key on my keyboard, because I often hit it accidentaly when typing, and it messes up my text.
I found I can use xmodmap to disable insert key completely:
xmodmap -e "keycode 106 ="
This works, but there is another problem. Turns out, midnight commander uses the insert key for entirely different purpose. Not for toggling overtype, as in text editor, but for selecting multiple files.
This feature in mc is actually useful, and I am using it quite often.
Is there any way to disable the insert key in text editors in its role as overtype ON/OFF, but to keep it in its second role as "selecting files" in mc ?
|
Make the Insert key send a different keysym (the symbolic name of the key that determines what key applications think it is), for example F25.
xmodmap -e "keycode 106 = F25"
Configure mc to recognize f25 as a binding for the Mark command: copy /etc/mc.keymap (or wherever the keymap you're using is located) to ~/.mc/mc.keymap and change the line Mark = insert; ctrl-t to Mark = insert; f25; ctrl-t.
| disable insert key for all but one applications |
1,481,241,149,000 |
I'm using Linux (Mint Mate), is it possible to input following characters directly via keyboard, which are phonetic symbols:
ə, ɔ, ŋ, ..
|
Lets try...
(1) decision: map ə, ɔ, ŋ, to (ALTGR+ e c n )
(2) using xmodmap command get the current definition of those chars (e,c,n):
xmodmap -pke | grep '= [ecn] ' > myfon.xmap
myfon.xmap has 3 lines like:
keycode 26 = e E e E EuroSign cent e E e E
keycode 54 = c C c C cent copyright cent copyright c C
keycode 57 = n N n N n N n N n N
(3) ALTGR is the 5th column; replace it by the unicode of 'ə, ɔ, ŋ,' ( ipa-unicode )
keycode 26 = e E e E U0259 cent e E e E
keycode 54 = c C c C U0254 copyright cent copyright c C
keycode 57 = n N n N U014b N n N n N
(3) activate this keyboard redefinition: xmodmap myfon.xmap
(4) press (altgr+e) and pray...
| Input characters from phonetic symbols via keyboard |
1,481,241,149,000 |
Im writing the ~/.bashrc file.
I want to bind, Alt-c to Ctrl-u.
So that when I press Alt-c. The functionality of Ctrl-u should happen.
Ctrl-u clears the text on the terminal.
So Alt-c should now do that.
I have the following text:
# Avoids default mapping.
# set bind-tty-special-chars off
# Solves error: 'bind editing not enabled.'
# But prevented me from using Control-p/n.
set -o vi;
# Up Directory (Alt-j)
bind '"\ej": "cd ..;\r"';
Which successfully binds alt-j to the code "cd ..;"
But I don't know how to map alt to a Ctrl mapping.
It probably has something to do with the "set -o vi". But I can't remove it without getting the bind error.
Also, unsetting "set -o vi" causes side effects such that i cannot press tab in the terminal anymore. They also say that its just a choice between emacs and vi, so I think for my future its best if I could simply have set -o vi on, for im completely in Vim.
I have also tried having the following before the set -o vi, it doesn't work.
# Clear Text (Alt-c)
bind '"\ec": "Control-u:"';
But anyways.
How do I map Alt-c to Ctrl-u?
|
Ctrl+u invokes the unix-line-discard widget in both vi command and insert modes:
bash-5.2$ set -o vi
bash-5.2$ bind -pm vi-command | grep -iw c-u
"\C-u": unix-line-discard
bash-5.2$ bind -pm vi-insert | grep -iw c-u
"\C-u": unix-line-discard
You'd bind Alt+c to do the same by either making it invoke the same widget:
bind -m vi-command '"\ec": unix-line-discard'
bind -m vi-insert '"\ec": unix-line-discard'
Or making it translate to the ^U character:
bind -m vi-command '"\ec": "\C-u"'
bind -m vi-insert '"\ec": "\C-u"'
| Map Alt-c to Ctrl-u |
1,481,241,149,000 |
I'm running CentOS 7 on a Dell laptop. The native keyboard works correctly, but my Logitech MX Keys keyboard is sending some incorrect modifiers:
Pressing L WIN triggers L ALT
Pressing L ALT triggers L WIN
Pressing R ALT triggers R WIN (the keyboard lacks R WIN)
Pressing R CTRL triggers R ALT
Insert key is not detected at all
Default xbkmap settings:
$ setxkbmap -query
rules: evdev
model: pc105+inet
layout: us,us
variant: ,
options: terminate:ctrl_alt_bksp
I tried using options to fix the problem:
$ setxkbmap -option altwin:swap_alt_win
$ setxkbmap -query
rules: evdev
model: pc105+inet
layout: us,us
variant: ,
options: terminate:ctrl_alt_bksp,altwin:swap_alt_win
This fixes the left modifiers and R ALT, but now:
Pressing R CTRL triggers R WIN
So I took a stab at combining another swap option:
$ setxkbmap -option ctrl:swap_rwin_rctl
$ setxkbmap -query
rules: evdev
model: pc105+inet
layout: us,us
variant: ,
options: terminate:ctrl_alt_bksp,altwin:swap_alt_win,ctrl:swap_rwin_rctl
But that made it worse:
R ALT triggers R CTRL
R CTRL triggers R WIN
I looked through the options at /usr/share/X11/xkb/rules/evdev.lst, but can't find any that address my particular situation.
I'd prefer a persistent solution, but I'm willing to add it to my startup scripts if need be.
I don't use the native keyboard, so I'm ok with a solution that breaks it.
|
JdeBP's comment led me to Logitech's setup instruction for MX Keys, which indicate Fn+O for Mac and Fn+P for Windows/Linux/Chrome. I recall taking the current Logitech Unifying Adapter from a MacBook, so I probably previously configured it for that and forgot.
I cleared all of my previous Xkb options and set the keyboard to Windows/Linux/Chrome mode. This fixed all of the keys, even after a reboot.
From what I can tell, these OS-specific configurations are tied individually to each of the 3 preset connection keys. When I was using the keyboard on both Windows and Mac machines, I never recall having to repeat the OS-specific keystrokes. This is likely why I forgot about the feature.
| Logitech MX Keys sends incorrect modifier keys |
1,481,241,149,000 |
I'm currently working on a project where I want to control my PC with an AVR, via emulating a PS/2 keyboard. For this reason I currently have all the required hardware and some software libs, such as https://github.com/ndusart/ps2-keyboard for the AVR and http://python-evdev.readthedocs.io/en/latest/index.html for the PC part.
I also read about the PS/2 protocol from http://www.pcbheaven.com/wikipages/The_PS2_protocol/, http://www.computer-engineering.org/ps2protocol/ and http://retired.beyondlogic.org/keyboard/keybrd.htm
Then I've ran the command sudo cat /dev/input/by-path/platform-i8042-serio-0-event-kbd > ./kbrd.hex and connected a keyboard, then pressed and released the backspace.
I would except something like AA 66 F0 66, and maybe some FA's (ACK) in between, but what I've got is very different:
So my question:
Could this be caused by my misunderstanding of the working behavior of /dev/input/, or the problem is in the other parts of my setup?
I expect to get the raw input from the buffer from /dev/input/, and this isn't that I think the raw should be.
EDIT
Another hexdump AFTER plugging in the keyboard:
|
The way you describe the process, you: started capturing output, plugged in the keyboard, pressed a key, then stopped capturing. If that is the case, I would recommend plugging in the keyboard, start capture, press key, stop capture?
EDIT: Adding additional information
I haven't gotten anything in my own quick research to fully line up with your dumps so far, but:
Per kernel.org documentation and source code, output from /dev/input interfaces is in the format:
struct input_event {
struct timeval time;
unsigned short type;
unsigned short code;
unsigned int value;
};
Which equates to:
timeval: 16 bytes (8 bytes for seconds, 8 bytes for microseconds)
type: 2 bytes
01 for EV_KEY (keypress). See input-event-codes.h
code: 2 bytes
0E for KEY_BACKSPACE. See input-event-codes.h
value: 4 bytes 01 for keypress, 00 for release, 02 for autorepeat
| Reading /dev/input/ of PS/2 keyboard |
1,481,241,149,000 |
I've just installed Arch Linux with LXDE and Openbox on my Asus Eee PC 1000. I can't get my F11 key to work in any application. It doesn't appear to do anything when I press it.
I installed xev, and the F11 key doesn't generate a KeyPress event like the other function keys do. Here's what I get when I press F12:
KeyPress event, serial 46, synthetic NO, window 0x2400001,
root 0xac, subw 0x0, time 11144523, (-49,121), root:(789,347),
state 0x0, keycode 96 (keysym 0xffc9, F12), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 46, synthetic NO, window 0x2400001,
root 0xac, subw 0x0, time 11144627, (-49,121), root:(789,347),
state 0x0, keycode 96 (keysym 0xffc9, F12), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
The other function keys look similar. But here's what I get when I press F11:
FocusOut event, serial 46, synthetic NO, window 0x2400001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 46, synthetic NO, window 0x2400001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 46, synthetic NO, window 0x0,
keys: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
In ~/.config/openbox/lxde-rc.xml I found this snippet:
<!--keybindings for LXPanel -->
...
<keybind key="F11">
<action name="ToggleFullscreen"/>
</keybind>
But I commented that out, logged out, and logged back in. It didn't make any difference.
How do I get my F11 key back? I use full screen in Firefox all the time, and I need it.
|
Apparently, it was the entry in ~/.config/openbox/lxde-rc.xml. Logging out and back in wasn't enough for some reason, but I rebooted and now my F11 key is back in action.
| What's stealing my F11 key? |
1,481,241,149,000 |
On my laptop the Alt and Windows keys are in the opposite positions that I'd prefer them in. Swapping them is fairly easy. However, my external (USB) keyboard has the Alt and Windows keys in the order I prefer, meaning when I switch over to the external keyboard I have the unpreferable keyboard arrangement.
Is there some manner of Linux-y voodoo I can invoke to detect whether input is coming from an external keyboard or not, and have it swap the two keys accordingly? If that's pushing it, I'd settle for a way to detect when an external keyboard is plugged in. Or are there any other reasonable solutions that I haven't considered?
|
You can have entirely different layout settings for every keyboard you connect; the Unreliable Guide to xkb configuration might be helpful. In your case, you might get by with "Doing it the easy way" therein.
Be advised, though, that the guide was written at a time when the X server had a config file that was honoured. Since then, configuration of the keyboard has moved at least into HAL and back out again, so heaven knows where you have to put your extra Options "XkbOptions" "..." when it's a new moon now.
If all else fails and your X is sufficiently recent, yes, get the device number from xinput list and call setxkbmap -device ... ..., call it in your X startup file and maybe also look at udev to be notified when that keyboard is plugged in.
| Swap alt and windows key except when using an external keyboard |
1,481,241,149,000 |
I switched my keyboard layout to Polish, in which Alt_R is used to generate various non-Latin letters. Some of them are working, and some aren't:
Alt_R-l generates "ł", as it should
Alt_R-c should generate "ć" but instead starts Chromium
several other Alt_R key combinations also start various programs, or move the current window down by a small distance, or do nothing
Where are those functions coming from? There's nothing about it in my Settings->Keyboard dialog, or in ~/.Xmodmap - what are other places where systemwide keyboard shortcuts or other keyboard modifications might be defined? Is there an exhaustive list?
Better yet, is there a way to find out what application/system is reacting to a key combination like Alt_R-c so that I can then figure out where it keeps its keybindings?
This is on Xubuntu 20.04.3.
|
There's a keysym XF86LogGrabInfo which when pressed causes the X Server to print information about all the grabs in its log file (usually /var/log/Xorg.$DISPLAY.log). If you have xdotool installed, you can trigger that key with a command like
xdotool key XF86LogGrabInfo
From there you could identify the culprit X11 client. For instance, to determine which X11 client is messing with the "Space" key, I first get the keycode bound to the space keysym:
$ xkbcomp $DISPLAY - | grep SPCE
<SPCE> = 65;
key <SPCE> { [ space ] };
(you can also use xev + press Space for that), then I search for it through Xorg.$DISPLAY.log:
$ awk '/registered grabs of client/{c=$0}/detail 65/{if(c)print c; c=""; print}' /var/log/Xorg.0.log
[452727.209] Printing all registered grabs of client pid 32055 openbox --config-file /home/pi/.config/openbox/lxde-pi-rc.xml
[452727.220] detail 65 (mask 0), modifiersDetail 8 (mask 0)
[452727.220] detail 65 (mask 0), modifiersDetail 24 (mask 0)
[452727.220] detail 65 (mask 0), modifiersDetail 10 (mask 0)
[452727.220] detail 65 (mask 0), modifiersDetail 26 (mask 0)
[452727.241] detail 65 (mask 0), modifiersDetail 12 (mask 0)
[452727.241] detail 65 (mask 0), modifiersDetail 28 (mask 0)
[452727.241] detail 65 (mask 0), modifiersDetail 14 (mask 0)
[452727.241] detail 65 (mask 0), modifiersDetail 30 (mask 0)
modifiersDetail 8 is Mod1Mask aka Alt, etc.
So it's openbox which is stealing the Alt-Space key combo.
Notice that the pids and command lines of the clients are not always accurate; they're those of the processes who connected to the Xorg unix domain socket, which may no longer exist if they forked in the meanwhile and their children inherited the socket file descriptor (That's a general problem with the naive misuse of SO_PEERCRED "authentification", which is quite a long story ;-))
| How to find out where systemwide keybindings come from, and remove them? |
1,481,241,149,000 |
I've just bought a new laptop from Asus: Rog Strix Scar G17 G733QS and I tried installing Ubuntu 20.04 on it.
The problem is that every time I press any key on the laptop keyboard, the shut-down dialog/pop-up appears and if I forget about this and mistakenly press multiple keys, the laptop shuts down.
It seems that I can use Ubuntu just fine with a USB keyboard, but this is clearly not okay.
Do you have any idea about what I could do?
Update 1: I encountered the same behaviour on Fedora 33, but the live OS worked fine. Maybe the driver in the kernel is not compatible with the controller of the keyboard?
Update 2: I also tested Linux Mint with Cinnamon and everything works fine so far! Since both Ubuntu 20.04 and Fedora 33 use GNOME, I suspect it is somehow related to the DE. I further suspect that the underlying problem has to do with the preinstalled nouveau drivers which at the moment do not support the RTX 3080 laptop in the laptop because I got a warning, right before the DE gest loaded at boot time, saying that the device was not recognized.
Update 3: Now, one day later, the same behaviour started on Linux Mint too. When I press any key on the laptop's keyboard, the associated letter is generated if inside a text editor, but also the shut down dialog appears. When using an external keyboard, everything works fine. As recommended by Jason Croyle, here is the output of xev associated with me pressing a key on the laptop's keyboard:
MappingNotify event, serial 44, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 44, synthetic NO, window 0x5000001,
root 0x50f, subw 0x0, time 423525, (-550,168), root:(942,438),
state 0x0, keycode 24 (keysym 0x71, q), same_screen YES,
XLookupString gives 1 bytes: (71) "q"
XmbLookupString gives 1 bytes: (71) "q"
XFilterEvent returns: False
KeyRelease event, serial 45, synthetic NO, window 0x5000001,
root 0x50f, subw 0x0, time 423602, (-550,168), root:(942,438),
state 0x0, keycode 24 (keysym 0x71, q), same_screen YES,
XLookupString gives 1 bytes: (71) "q"
XFilterEvent returns: False
MappingNotify event, serial 45, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
FocusOut event, serial 45, synthetic NO, window 0x5000001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 46, synthetic NO, window 0x5000001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 46, synthetic NO, window 0x0,
keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
as opposed to the output of xev when pressing a key on the external keyboard:
KeyPress event, serial 38, synthetic NO, window 0x6200001,
root 0x50f, subw 0x0, time 826960, (-20,-2), root:(841,452),
state 0x0, keycode 24 (keysym 0x71, q), same_screen YES,
XLookupString gives 1 bytes: (71) "q"
XmbLookupString gives 1 bytes: (71) "q"
XFilterEvent returns: False
KeyRelease event, serial 38, synthetic NO, window 0x6200001,
root 0x50f, subw 0x0, time 827056, (-20,-2), root:(841,452),
state 0x0, keycode 24 (keysym 0x71, q), same_screen YES,
XLookupString gives 1 bytes: (71) "q"
XFilterEvent returns: False
After searching the extra events, I found out that KeymapNotify happens everytime an application is awakened and is a way to inform that application about the state of the keyboard. I suspect this happens because the shut-down dialog is the awakened application in this case.
The MappingNotify event, on the other hand, seems to point out that the mapping of the physical key press has changed. And it seems like this happens once for the key press and once for the key release.
|
This is related to Linux kernell 5.11/Nvidia 30* video cards.
After update to 5.11 following these steps, the system becomes stable
update to 5.11 https://sypalo.com/how-to-upgrade-ubuntu
In case after the restart, the screen remains black with an error message use the advanced option choose 5.11 (recovery mode)
do these steps https://forums.developer.nvidia.com/t/ubuntu-mate-20-04-with-rtx-3070-on-ryzen-5900-black-screen-after-boot/167681/30
| Using laptop keyboard shuts down computer |
1,481,241,149,000 |
I have usb barcode scanner that emulates keyboard. When it is connected, X gets the control and handles it as an usual keyboard and sends keyboard events to the current focused window.
This is not what I want to do. I have a program that read barcodes from ascii input stream and process them. This program runs at background and has no user interface at all.
How to configure Linux to not use this usb keyboard in X, but map it as a ascii stream device. This way, I will be able to redirect it as an input device for my program and to provide reading the barcodes, regardless of the input focus changes. And the barcodes should not be passed to the currently focused window at all.
In addition, it is better to not run the barcode handling program as a root, so the keyboard device should have read permissions for everyone.
|
1) How to configure X to ignore the keyboard
Use lsusb to find the ID of your barcode scanner (in format 0123:4567). Create or modify an xorg.conf file (usually in /etc/X11/). Add a InputClass section with the ID you just found:
Section "InputClass"
Identifier "barcode"
MatchUSBID "0123:4567"
Option "Ignore" "true"
EndSection
Restart X, verify in Xorg.log that your device is recognized by this section and ignored.
2) The conversion from keypresses to ASCII (or other) codes is pretty involved, to allow for different keyboard layouts, dead keys, customizations etc. Now that you disabled the X conversion layer, you can receive keypress and keyrelease events from the appropriate /dev/input/eventX device. The number can change; for your barcode reader, there will be a symlink in /dev/input/by-id/ which doesn't change. So use the symlink.
You can run evtest on this file to see what kind of events it generates. They mapping for your barcode reader will be simple, so a table lookup from keysym to ASCII code will do. You can process these events in your own program, see the evtest source, or e.g. here. You can also write a small C program which just reads this device and produces ASCII on stdout, and then integrate it into your application using a pipe etc.
"Mapping it as an ASCII stream device" is not possible, such devices don't exist in the Linux kernel.
3) Setting permissions
You need to write a custom udev rule to set permissions for your input device. SUBSYSTEM must match input, ACTION must match ADD, the environment ENV should contain information to match the device (use udevadm to find out details), and you can set OWNER, GROUP and MODE for the newly created /dev/input/eventX device. Here's a somewhat general howto , I couldn't find a more specific one. Google for better tutorials.
| Usb keyboard use separately in X |
1,481,241,149,000 |
I have a simple script to turn my keyboard of written using xinput. How can I get the current state of the device (enabled or disabled) so that when I run the script I can don't have to specify on/off, it just reverses the state?
(warning - this might turn your keyboard off; handle with care)
#!/bin/bash
case "$1" in
on)
export DISPLAY=:0
xinput set-prop 14 "Device Enabled" 1
killall -q onboard
;;
off)
onboard &> /dev/null 2>&1
export DISPLAY=:0
xinput set-prop 14 "Device Enabled" 0
;;
esac
now I run: ./my_keyboard on if the keyboard is off. I would like to just run ./my_keyboard and have it change state. There doesn't appear to be anything in the xinput docs (query-state does not have the property).
|
To directly answer your question: You can parse the output of this command to get the state of the device:
xinput list-props $DEVICE_NAME_OR_ID
I think the device id may vary, so I recommend using the name. I'm not sure about this though.
I wrote a small script to toggle my own touch pad:
#!/bin/bash
DEVICE='SynPS/2 Synaptics TouchPad'
enabled=$(xinput list-props "$DEVICE" | awk '/^\tDevice Enabled \([0-9]+\):\t[01]/ {print $NF}')
case $enabled in
0)
xinput enable "$DEVICE"
echo "$DEVICE enabled"
;;
1)
xinput disable "$DEVICE"
echo "$DEVICE disabled"
;;
*)
echo
xinput list --name-only
;;
esac
| using xinput to get device state |
1,481,241,149,000 |
On my keyboard, when I press a key very lightly and release it quickly (talking about probably 0.1s of button press here), the key does not issue a release event correctly and instead typed repeatedly if key repeat is turned on - as if I had never let go of the key.
It's quite hard to do it intentionally but it happens enough to be a quite nuisance.
I've tested the key events using xev. There's no difference between actually keeping the key pressed and releasing it in such a matter that no release event is issued.
My keyboard does not do this under Windows, I suspect there might be some kind of driver problem(?).
Note/Workaround:
For now, I've gone to only enabling key repeat on my arrow keys and backspaces because that's the only place I need. xset -r [keycode] does work correctly when key repeat is turned on in the gnome settings, otherwise it doesn't. I'm pretty certain that this information is non-relevant to solving the problem but if any one else has this issue they might find it helpful.
My OS is Fedora 22, latest version. I have a Dell XPS 13 9343 (2015 model).
Edit:
Output for dmidecode -t bios -q:
sudo dmidecode -t bios -q
BIOS Information
Vendor: Dell Inc.
Version: A00
Release Date: 11/04/2014
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 8192 kB
Characteristics:
PCI is supported
PNP is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
EDD is supported
5.25"/1.2 MB floppy services are supported (int 13h)
3.5"/720 kB floppy services are supported (int 13h)
3.5"/2.88 MB floppy services are supported (int 13h)
Print screen service is supported (int 5h)
8042 keyboard services are supported (int 9h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
ACPI is supported
USB legacy is supported
Smart battery is supported
BIOS boot specification is supported
Function key-initiated network boot is supported
Targeted content distribution is supported
UEFI is supported
BIOS Revision: 5.6
BIOS Language Information
Language Description Format: Long
Installable Languages: 1
en|US|iso8859-1
Currently Installed Language: en|US|iso8859-1
|
The problem is likely due to a HW / (and|or) / BIOS issue.
XPS 13 (9343) unwanted keyboard character repeat
Your BIOS version is A00, which was initial release. The current release is A07. Keyboard issue was fixed in A05+.
You would likely want to follow this site, the Product Support page for your model, (or the like).
This is a development repository targeting Linux, which also have some links you might find interesting. Here the key-repeat issue is also mentioned.
BIOS releases:
A short re-cap on changes and release info from DELL. Not the best of change-logs though.
A00, 13 Jan 2015 (Optional :)
Initial Release
A01, 25 Feb 2015 (Optional)
Update CPU Microcode 0x306D4 to Rev 0x18.
Update ePSA to4236.24.
A02, 22 Mar 2015 (Recommended)
Update Fan management
Update Intel CPU microcode
A03, 30 Mar 2015 (Recommended)
Fix I3-5010 CPU performance issue.
A04, 25 May 2015 (Recommended)
Improved Keyboard behavior
Update CPU Microcode.
A05, 31 Jul 2015 (Urgent)
Improved Keyboard behavior
Update CPU Microcode.
WIN10 BIOS Support
A06 (Did they jump directly to A07?)
A07, 26 Nov 2015 (Recommended)
Improve Double Key issue
Add Support for Ubuntu PTT feature
| Key is not being released on very short keypresses |
1,481,241,149,000 |
I am so used to emacs keybinding that I use emacs style keybindings on my entire system (with gtk settings). I've mapped Caps-Lock key to an extra Control key. But that doesn't help me from having pain after a few hour of work.
What I hope to do, is to map a character key (I'm looking at l) in a way that it functions normally on a Key_Press followed by a Key_Release, but acts as a Control key between the period of those two event - or effectively, when another key is pressed during that interval.
First off all, is this possible?
If yes, how would you do that?
Second, do you have any other suggestions on getting some work off the left pinky?
|
There's a project for X on Linux-based systems that does what you are asking, called at-home-modifier, designed to keep your fingers at the home row (hence the name). The example given in their instructions is to map the space key to shift: If the space key is used alone, it's a space; if used with another key, it's shift. They also say that "Any pairs of keys are possible" for your use case with the L key doing double duty as Control.
Have a look here:
https://gitlab.com/at-home-modifier/at-home-modifier-evdev/wikis/home
| Map a Character key to some modifier key [say Control-key]? |
1,403,565,920,000 |
I've been thinking that I want a mechanical keyboard, currently I'm using a logitech G510 which is perfect with it's 18 programmable keys (I'm using it with this) but I hear a lot of people drooling over mechanical keys, especially programmers, and I do certainly write a lot and on occasion I code too. Not to mention gaming of course.
But one thing I really cannot think of losing is the 18(x3) programmables, I don't care about the rest of the features, but being able to open folders, switch workspaces and navigate through my browser with single buttons changes everything. Not to mention it is very efficient.
Media keys are also always nice (Play/Pause, Volume wheel)
The Corsair Vengeance K-95 was the first keyboard I found that seems to match my needs.
Does it work with Linux? (If so, how well?)
Can I map custom commands (like terminal commands) to the G keys?
|
This keyboard doesn't work properly on Linux. The entire keyboard freezes if you press any macro key.
To be more precise, a kernel issue is currently in progress[1], and a userpace driver is available with some limitations[2].
[1] Bug 79251 - Keyboard status indicators not functioning properly.
[2] K70/K95 RGB (Unofficial) Linux Driver
| Corsair Vengeance K-95 Keyboard & Linux [closed] |
1,403,565,920,000 |
I found that in my LinuxMint 13.10, when I wanted to type a @ (Shift+2), the screen displayed " (Shift+' in windows).
However, the biggest problem is there are no ways to type |.
Therefore, I would like to ask how I can change the keyboard settings?
|
You must change the keyboard layout. You can use your desktop environment's settings options for that. For example for Mint 15 Cinnamon you can follow http://forums.linuxmint.com/viewtopic.php?f=90&t=135675 . Please identify the exact Linux Mint desktop environment you are using to help you more if you can not find it.
| Cannot type certain special characters in LinuxMint |
1,403,565,920,000 |
How can I print out the current keybindings in Linux/Debian ? I tried
xmodmap -pp
and got the response:
xmodmap: unable to open display ''
|
You have two different keymaps. One used by your graphical environment (X) and one used by you console.
The first one is configured by xmodmap and setxkbmap. The second one is configured by loadkeys.
You can dump the first one with xmodmap and the second one with dumpkeys.
Have a look at the man pages of those commands to find the correct options and other related commands.
| How can I print out the current keybindings in Linux/Debian? [closed] |
1,403,565,920,000 |
I am using tmux a lot, and I have already managed to tune my OS X terminal to send the correct key codes for Ctrl+left and right arrow (\033b and \033f). I found those information on the web. However, I also need Ctrl+up and down to work correctly. How do I find out which key codes tmux expects? The TERM variable is set to screen while inside of tmux. Can I query the terminal database on my Linux machine for the codes?
At the moment, my OS X terminal simply sends arrow left and right, without the Ctrl modifier.
|
I just found that tmux seems to expect xterm keycodes, not minding the screen terminal type. Hence I just punched the keys in xterm, using Ctrl-V as a prefix and got these codes:
left key: ^[[D
right key: ^[[C
up key: ^[[A
down key: ^[[B
C-left: ^[[1;5D
C-right: ^[[1;5C
C-up: ^[[1;5A
C-down: ^[[1;5B
I can now configure OS X terminal to send those key codes, and tmux works fine. However, other apps running in tmux will break, because they don't expect to get xterm key codes. I found a workaround in the ArchWiki, which suggests to create your own terminfo entry. I will try that.
Edit: The tmux FAQ got me going, and I added the following two lines to my ~/.tmux.conf:
set -g default-terminal "xterm-256color"
setw -g xterm-keys on
Now I can use C-arrows in tmux, bash, emacs and other programs.
One more edit: Since tmux does not support bce (background color erasing), I needed to make my own terminfo, called xterm-256color-nobce:
infocmp xterm-256color | sed 's/bce, //' > xterm-256color-nobce
sudo tic ./xterm-256color-nobce
And made sure to use that as my default TERM value.
| How do I find out the keycodes for Ctrl+up and down arrow for TERM=screen? |
1,403,565,920,000 |
I have created a BIOS password. I use the Dvorak keyboard layout. When I switch my keyboard layout to Qwerty and restart, and then type password in with the different layout, there is no change. However, when I'm logged into my OS, having a different keyboard layout matters. What's going on here?
|
Many people get confused because they see the computer as a single entity when in actuality a computer is several systems working together to give the illusion that it's one cohesive object.
Multiple subsystems
The BIOS is one of of these such subsystems. The BIOS is exactly what its name describes. A Basic Input and Output System. Its job is to provide basic functionality to the system so that it can detect peripherals (such as: HDDs, keyboards, monitors, etc.). The other major function that the BIOS provides is in boot strap loading the Operating System from the designated medium (CD, DVD, USB, HDD, etc.).
The functionality to provide access to these peripherals provides an API which the OS and software can make use of if they so choose, but the operating systems and software don't have to make use of these APIs and often times do not, for a variety of reasons.
The major reason is that the device manufacturer knows best and will often times provide a low level driver themselves which can deal with the hardware in a more intimate way than the general purpose BIOS is able to.
Your question is exactly this scenario. The BIOS is able to detect the keyboard and deal with it using its own software/drivers, whereas the OS is not able to.
There's really nothing more to this than that.
MS-DOS API
If you'd like a more concrete example then you don't have to look any further than the interrupt 21 facility that was popularized by MS-DOS. MS-DOS provided its own screen services that sat along side the BIOS' because Microsoft wanted to have either richer features or a different API altogether.
See the wikipedia page: MSDOS API.
| How does a BIOS password work? |
1,403,565,920,000 |
I've been playing around xmodmap to create a custom keyboard (refer to Get the keycode of a key, from a custom made keyboard also).
But now, I can't use the N key anymore, but the Shift+N still works fine.
I think I messed up something, so I performed a reset to defaults of my keyboard (using the Ubuntu system settings).
Now everything seems to work ok, except my N key, my Shift+N key works.
How can I get that key working again?
|
that was some .xbindkeysrc file that messed up all that. I removed it, and it's ok now.
| The n key doesn't work anymore but N does |
1,403,565,920,000 |
I installed autokey-gtk application but it won't start. When I run it from terminal it will write a message:
Xlib.protocol.request.QueryExtension
but that's all. The application won't start.
Do you know what is wrong?
|
8 years leater, but hopefully still useful for someone. From https://askubuntu.com/a/304834:
The first time you launch AutoKey, it will start the service in the
background (the notification icon hasn't been updated for unity, so
there's no visual indication). Once it's running, you can bring up the
configuration interface by running the launcher again
So, Ubuntu 19.04 I have to type autokey twice from terminal. From dash once is sufficient.
Perhaps also useful: if Autokey does not start at login but you still selected that option, look at https://github.com/autokey/autokey/issues/149
| Autokey won't start |
1,403,565,920,000 |
On my new laptop keyboard, there's a strange key next to my shift key. Frankly it's useless to me and having a shorter shift key doesn't let me reach some of the combinations that I was used to. I'd like to turn it that key into a left shift as well so that I have one long left shift again.
First I've tried xmodmap according to this answer, and same as him, I've had no success.
Then I tried to create a new xmodmap config by copying the entry of the left shift key into the strange key's row. Applying the settings however took very long (>10s) so having that in my bashrc was not an option, since it made opening new terminal tabs take way too long. It also didn't work in X either, only terminals. I also read that xmodmap is mostly considered outdated.
Lastly I tried to use xkb but frankly couldn't really figure out how according to entries on the Arch wiki and here.
|
You can remap scancodes to keycodes with udev, this works whether you are using xorg, wayland or the virtual console.
The scan code can be obtained with the evtest command. Select your keyboard when evtest ask for device to scan, and press the key you want to remap. Here is a sample output when alt key is pressed
Event: time 1688218985.587133, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2
Event: time 1688218985.587133, type 1 (EV_KEY), code 29 (KEY_LEFTALT), value 1
Then create an hwdb file that maps scancodes to keycodes in /etc/udev/hwdb.d.
This file remaps CapsLock to Shift, for example.
# generic keyword
evdev:input:b0003v*p*
KEYBOARD_KEY_70039=shift
Finally, run the following command to apply the change.
systemd-hwdb update
udevadm trigger
See Map scancodes to keycodes for detailed instructions and more examples.
Note:
If you have an AT keyboard, use evdev:atkbd:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr* to match your keyboard.
A list of input event code can be found from header linux/include/uapi/linux/input-event-codes.h
| How to remap a regular key into a modifier key (Shift...) in Linux |
1,403,565,920,000 |
I'm looking for a way to replace my keyboard kernel module to a custom one. I have a Logitech MK710 keyboard + mouse set for this purpose, with a USB receiver with those 2 interfaces. Automatically, this USB receiver is managed by default usb, usbhid or logitech-hidpp-device modules, there is some information (note: 1-2 is the receiver device):
ubuntu@ubuntu-VirtualBox:/sys/bus/usb/devices/1-2$ tree | grep driver
│ ├── driver -> ../../../../../../bus/usb/drivers/usbhid
│ ├── driver -> ../../../../../../bus/usb/drivers/usbhid
│ │ │ ├── driver -> ../../../../../../../../bus/hid/drivers/logitech-hidpp-device
│ │ │ ├── driver -> ../../../../../../../../bus/hid/drivers/logitech-hidpp-device
│ │ ├── driver -> ../../../../../../../bus/hid/drivers/logitech-djreceiver
│ ├── driver -> ../../../../../../bus/usb/drivers/usbhid
├── driver -> ../../../../../bus/usb/drivers/usb
What I want to achieve is write a proper module which would be chosen by a kernel instead of those default drivers. I think it's a matter of writing a proper module alias, but I'm not sure because nothing worked yet. Things I already tried are:
put my module inside /lib/modules/$(uname -r)/kernel/drivers directory (I created my own custom subdir inside and put the .ko file there)
use a proper alias in the module C code, I tried all options listed below (note: USB_VENDOR_ID and USB_PRODUCT_ID are macros used by me and their values are set properly for my specific device):
static struct hid_device_id mod_table [] = {
{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID, USB_PRODUCT_ID) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(hid, mod_table);
or
static struct hid_device_id mod_table [] = {
{ HID_USB_DEVICE(USB_VENDOR_ID, USB_PRODUCT_ID) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(hid, mod_table);
and
static struct usb_device_id mod_table [] = {
{ USB_DEVICE(USB_VENDOR_ID, USB_PRODUCT_ID) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, mod_table);
remove original (default) HID drivers from /lib/modules/$(uname -r)/kernel/drivers directory (those 3 I specified at the top).
Yet still kernel chooses to load original modules instead of my own. I even made sure that only my driver's alias specifies the vendor and product IDs (checking it in modules.alias file), but nothing works. The module starts to work only when I decide to detach the kernel drivers manually from user space by libusb library (using libusb_detach_kernel_driver function) and reload my own custom module - only then the kernel associates the device with my driver, but that's only till the next boot. I'd like to make it permanent, or even automatic. I hope the whole concept is understandable and is not too big of a mess. Thanks in advance.
|
Most likely you are being tripped up by initramfs: a copy of the original HID driver module has been stored in there when your current kernel was installed, and if you haven't regenerated initramfs when adding your module, your customized one won't be in there.
At boot time, the USB support modules are among the first to be loaded, when the system is still running on initramfs and the real root filesystem has not been mounted yet. So the system is still finding & loading the original usbhid + logitech-hidpp-device module combination.
You seem to be using Ubuntu, so the Debian-style sudo update-initramfs -u command should be enough to rebuild the initramfs of the current kernel version using the current set of modules and other configuration files.
| Replace HID device driver with custom one |
1,403,565,920,000 |
With FreeBSD 11.1 and tmux 2.7, pressing ← (backspace) sends ^? and ctrl+← does also send ^?.
The default behavior (no tmux) is:
^H for ←
^? for ctrl+←
How can I get this default behavior with tmux? Or at least achieve that ← and ctrl+← don't send the same control character?
PS: okay, calling stty ek before starting tmux works. But isn't there some way to cleanly configure tmux?
|
tmux only pays attention to the stty settings (no config- or terminfo-data). Here's the code:
/*
* Check for backspace key using termios VERASE - the terminfo
* kbs entry is extremely unreliable, so cannot be safely
* used. termios should have a better idea.
*/
bspace = tty->tio.c_cc[VERASE];
if (bspace != _POSIX_VDISABLE && (key & KEYC_MASK_KEY) == bspace)
key = (key & KEYC_MASK_MOD) | KEYC_BSPACE;
So... setting stty is the only way to go.
| tmux: backspace and ctrl-backspace send both ^? |
1,403,565,920,000 |
I use several keyboards layouts on a regular basis. Two of which make use of dead keys for French language.
$ cat /etc/default/keyboard
XKBLAYOUT=us,fr,fr
XKBVARIANT=dvp,bepo,latin9
BACKSPACE=guess
This morning, after a sudo apt-get upgrade on Debian 9 (stretch), which may or may not be involved in the problem, dead keys stopped working as dead keys (i.e. hitting ^ then e produces ^e instead of ê), which makes typing french quite difficult.
The new behaviour is persistent after reboot and affects several applications:
firefox
thunderbird
gnome-terminal
gedit
nautilus
But not VLC or xterm.. what should I conclude?
How do I get my dead keys working again in all applications?
|
I had the same problem, on Debian Stretch, and I am using bépo too.
I solved it by using IBUS (yet I guess FCITX and some others can manage it too).
To me, dead keys worked fine in TTY. So I guess the problem «only» happen in software getting keyboard configuration from GUI (X?).
To install Ibus:
sudo apt-get install ibus
Ibus comes with a GUI configuration tool, and bépo is available.
Setting Ibus to start automatically with the session can help.
| Dead keys suddenly stopped working in GTK applications |
1,403,565,920,000 |
Possible Duplicate:
Associating a function in Emacs after looking up the code with M-x describe-key
I have typed the following macros on my .emacs file
(global-set-key (kbd "M-<left>") 'windmove-left) ; move to left windnow
(global-set-key (kbd "M-<right>") 'windmove-right) ; move to right window
(global-set-key (kbd "M-<up>") 'windmove-up) ; move to upper window
(global-set-key (kbd "M-<down>") 'windmove-down) ; move to lower window
However, when I press Alt+left or any of the other keyboard combinations, I get errors like the following in the minibuffer M-o 3 c is undefined.
Why doesn't it work? I thought I was following the syntax described here (kbd macro).
|
Terminals know characters, not keys, so keys with no corresponding character need to be translated into escape sequences and back. When you press Alt+Left, it is translated into the sequence of characters \eO3d where \e is an escape character. Unfortunately, some of these character sequences are not standardized, so you need to declare what your terminal sends to Emacs.
Press Ctrl+Q then the key combination (e.g. Alt+Left) to enter the key sequence in a buffer. The Ctrl+Q command tells Emacs to interpret the leading escape character literally. You'll see something like ^[O3d where that ^[ is not the two characters ^[ but an escape character, better written in an Emacs Lisp string as \e.
Add each key combination's escape sequence to input-decode-map. For example (this code goes into your .emacs):
(define-key input-decode-map "\eO3a" [M-up])
(define-key input-decode-map "\eO3b" [M-down])
(define-key input-decode-map "\eO3c" [M-right])
(define-key input-decode-map "\eO3d" [M-left])
(kbd "M-<up>") or (kbd "<M-up>") are alternative ways of writing [M-up].
Once you've declared these translations, Emacs will know that when the terminal sends e.g. ^[O3d it stands for the key combination Alt+Left, and your bindings will work.
| String syntax for the kbd macro in Emacs [duplicate] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.