Hot answers tagged key-mapping
7
Depending on how the terminal is configured, typing Alt+Key is like typing the Esc and Key keys in sequence, so it sends the ESC character (aka \e or ^[ or \033) followed by the character or sequence of characters sent upon pressing that Key.
Upon pressing Up, most terminal emulators send either the three characters \033[A or \033OA depending on whether ...
5
Yes, Gnome and KDE provide some of their own keyboard shortcuts in addition to the ones provided by their respective WMs.
However, this may not mean what you think. The fact that Fn + UpArrow produces the keysym XF86AudioRaiseVolume is mainly due to your laptop's keyboard. You can verify this by using xev again (in the Openbox environment); It should have ...
5
If you're using Linux, the best way to distinguish between input devices is to use the Linux Event Interface. After a device's hardware-specific input is decoded, it's converted to an intermediate Linux-specific event structure and made available by reading one or more of the character devices under /dev/input/. This is completely independent of the ...
5
On newer Debian and Ubuntu systems, your keyboard settings are put in /etc/default/keyboard and shared between X and the console. Just run
sudo dpkg-reconfigure keyboard-configuration
and select Compose key: Right Alt (AltGr) on the appropriate screen.
You could also put XKBOPTIONS=compose:ralt in /etc/default/keyboard and run
sudo dpkg-reconfigure ...
4
You can map any command in insert mode to anything using the :imap command, or save typing by using :im. For your first mapping, you could type (in normal mode):
:im <C-A> <esc>^i
Which goes to normal mode (with escape), presses ^ for you and goes back to insert mode. See the help for more info:
:help :imap or shorter: :h :im
Do note that you ...
3
You can use Crtl+v to return input codes of your keyboard. If you do that for arrow keys, you will get [[D^, [[C^, [[A^, and [[B values. There aren't any default bindings for Alt+arrow keys, so it seems that performed action is printing letter code alone. Hovewer, if you create your local version of readline library configuration file:
$ cp /etc/inputrc ...
3
See this wikia.com article for the exact thing you're tyring to do: http://vim.wikia.com/wiki/Map_Ctrl-S_to_save_current_or_new_files
In a nutshell you need to do the following.
1. Add this to ~/.vimrc
" If the current buffer has never been saved, it will have no name,
" call the file browser to save it, otherwise just save it.
nnoremap <silent> ...
3
Not a complete answer, but are you aware of Vim's so-called "easy mode" (vim -y)? It is always in edit mode by defaut, and does quite a lot of what you want, and doesn't need you to install or customise anything. It does CTRL-A, C, V, X, Y etc. From the key-listing:
Key mappings:
<Down> moves by screen lines rather than file lines
...
3
It's not possible with key bindings. Ctrl-G is hardcoded in mutt at a lower level than the macro or keybinding processing (see mutt_getch() in mutt's source code, at the core of all user input in mutt that returns an error upon ^G).
macro editor \e '^G'
wouldn't work either.
What you can do is configure your terminal to send ^G upon pressing Escape
With ...
2
"compose" on the console allows to type two characters but output a third one.
the problem is that the compose definitions use bytes, both as the two input (that is, you can't define compose in terms of typed keys but only in term of typed symbols) and for the output.
to make it work in UTF-8, which is multibyte (1 to 4 bytes, at least) would require great ...
2
The reason you're seeing what you are is because they're completely unassigned, and vim is processing the raw character sequence instead. Feel free to give them a useful purpose.
$ od -c <<< '<C-V><C-Left>'
0000000 033 [ 1 ; 5 D \n
0000007
$ od -c <<< '<C-V><C-Right>'
0000000 033 [ 1 ; 5 C \n
...
2
For permanent solution issue command in console:
echo 'keycode 13 = 4 backslash 4 ccedilla onequarter dollar onequarter' >> $HOME/.Xmodmap
then switch layout or issue xmodmap - < $HOME/.Xmodmap
For a one time (or to be executed at each startup from $HOME/.xinitrc):
xmodmap -e 'keycode 13 = 4 backslash 4 ccedilla onequarter dollar onequarter'
2
The closest equivalent would be to run the xmodmap program each time you log in.
Put the following snippet in a file called .Xmodmap in your home directory:
keycode 66 = Return
clear Lock
You can see the key codes and current associated key names by running xev from a terminal. Press Caps Lock while the xev window is focused, and you'll see a something ...
2
You can do it, but it's not particularly pleasant (and don't forget that in the default configuration, M-k and MS-k are already used to cycle between windows and move windows around in the stack order - you probably don't want to mask those functions).
What follows is based on a brief look at the source in XMonad/Config.hs. You will need to import ...
2
I got all the pieces together to do the trick. The best way is to create a custom mapping for all the commands:
map <F8> :let mycurf=expand("<cfile>")<cr><c-w> w :execute("e ".mycurf)<cr><c-w>p
Explanation:
map <F8> maps on "F8" the commands that follow
let mycurf=expand("<cfile>") gets the filename ...
2
You should be able to disable PrntScr on the console with a custom keymap. I'm using Archlinux and the procedure is described here: Configuring the Console Keymap (it should be similar for other distros). Now, at step 4, edit your personal.map:
Switch to a tty, run showkey and press PrntScr to get the key code. On my system the output is:
keycode 99 press
...
1
As far as I know there's no solution that works uniformly for both console and GUI, so you have to change it twice. Use loadkeys to modify the console keyboard and xmodmap for the X11 keyboard. The details, in particular for xmodmap, depend a lot on which keys you want to modify – there are differences between regular keys and modifier keys like Ctrl ...
1
The parsing error when loading your modified file is due to the missing semicolon at the end of the line; fix it and it will load.
But if you change AC10 key to send Alt_R, then it will send just an "Alt" modifier; if you want "AltGr", that is, a key to access 3d level symbols, then you have to send "ISO_Level3_Shift":
key <AC10> { [ ISO_Level3_Shift ...
1
the keys-file of fluxbox does not map keys to other keys; it maps keys to fluxbox-actions. So, you need something that maps keys to keys: man xmodmap.
xmodmap - utility for modifying keymaps and pointer button mappings in X
examples:
$> xmodmap -e "keysym Menu = Insert"
$> xmodmap -e "keycode 135 = Insert"
1
If xev doesn't register a response for a particular keypress, then you can try at the next level down with showkey, a command that must be issued from the console.
If showkey provides not information about a keypress, your final option is to see if it is registering with the kernel; follow the instructions on the Arch Linux Wiki multimedia keys page, and ...
1
You want the stty command: see how ^D is mapped with stty -a. You can change that to something else with stty eof char: Remove the "eof" setting with stty eof undef
Untested: you want to read about the trap command in the ksh man page. It might be sufficient for you to set up a handler for the EXIT signal.
# warning: completely untested
exit_handler() { ...
1
In the Debian-derived distros the console and X key mappings are now both set up in /etc/default/keyboard. See http://wiki.debian.org/Keyboard.
Before that both X and console key mappings were set up separately each with its own respective set of utilities and configuration files. See http://www.tldp.org/HOWTO/text/Keyboard-and-Console-HOWTO.
1
I made the <F4> key apparently work in all modes by using map <expr> expression maps as follows:
MapOptToggle <F4> relativenumber
MapOptToggle! <S-F4> number
command! -bang -nargs=+ MapOptToggle call <SID>MapOptToggle(<bang>0, <f-args>)
function! s:MapOptToggle(bang, key, opt)
function! s:ToggleOpt(opt)
if ...
1
The awesome FAQ provides an answer:
Why does Mod4 "swallow" succeeding key presses?
On some systems xkb by default maps the left windows key to "Multi_key" (at least in us and de layouts). Multi_key is an xkb feature which may be used to access uncommon symbols by pressing Multi_key and then (consecutively) two "normal" keys. The solution is to remap ...
1
You can use a special wildcard syntax with :set <Key> to let Vim automatically recognize xterm-style modified keys:
if &term =~ '^gnome'
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
execute "set <xHome>=\e[1;*H"
execute "set ...
1
Shift+Tab is often mapped to the ISO_Left_Tab keysym in X11, so some programs may need this instead of a literal 'shift-tab' in their configuration.
urxvt has a strange mapping on ctrl+shift, it looks like you will have to recompile to disable it: see this page for more details. EDIT It looks like in recent versions of rxvt you can simply add
...
Only top voted, non community-wiki answers of a minimum length are eligible

