Tag Info

Hot answers tagged

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 ...


6

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 ...


6

You can re-map keys with xmodmap. E.g.: xmodmap -e "keycode 79 = i I" To find correct keycode and alias use xev. Looking around a bit: this should give you needed details about persistent configuration etc.


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 ...


5

Try this (as a partial example): bind -n S-Right next-window bind -n S-Left previous-window That should be enough to make it easy to get the other 2 settings working too. It works on my tmux installation (1.4) but YMMV. You can also use the meta key (option on Macs, alt on PCs): bind-key -n M-Right next-window bind-key -n M-Left previous-window If ...


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

I assume you're trying to do this in shell or similar (else, you'd just use the X libraries directly). If so, you may find xinput --test ┬źdevice-name┬╗ much easier to parse. Unfortunately, it really isn't shell-scripting friendly. But you can make it work with stdbuf. It runs until you kill it, but your shell script could pipe it to read. So, you can do ...


4

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 ...


4

Take a look at this similar question over at superuser. Something like "xdotool key Home" End + Up in the .xbindkeysrc file should suffice. If you really want to try to use xmodmap, a start would be to map either the End key or the Up key to a modifier key in .Xmodmap. For example, you could grab your two keys with xev and map the End key to ...


4

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 ...


4

I think I know what's going on. You've not configured vim to disable vi compatibility mode. In vi, you can only press the arrow keys in command mode. When in insert mode, the character sequences sent upon pressing the arrow keys are treated as if the characters were entered individually. Now, upon startup, vi sets the terminal in keypad transmit mode ...


4

There is no scheme, screen, like any terminal application, doesn't deal with keystrokes, but with characters or sequences of characters which it reads from a terminal device. It's the terminal (or terminal emulator like xterm) that transforms a keystroke into a character or sequence of characters which it sends over a wire (the wire being virtual in the ...


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

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 ...


3

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 ...


3

For reference, here's archive.org's copy of the (dead) link in OP's question. The codes shown therein are emacs lisp style codes. I don't know much about them. Of course, there's more than one way to skin a cat, but what follows is probably the easiest: First, use showkey -a to get the hexadecimal representation for your keyboard sequence. For example, when ...


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

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 ...


3

Linux Console Keymaps To change the keymaps for the virtual terminals ( alt+f1 - alt+f6 ) you use loadkeys. This only effects the virtual terminal logins and will not change keymaping in X or X terminal apps like Xterm or urxvt. The loadkeys command needs to be run as root or you will get the following error: Couldn't get a file descriptor referring to the ...


3

You need root capabilities to use loadkeys. It is common to set the setuid permission bit on loadkeys. Setting this bit will cause any processes spawned by executing the loadkeys file to run as the owner of the file (usually root). For added security, you should change loadkeys's permissions to 750, make a group for it, and add any users that need to use ...


3

If you take a look at the ANSI ASCII standard, the lower part of the character set (the first 32) are reserved "control characters" (sometimes referred to as "escape sequences"). These are things like the NUL character, Life Feed, Carriage Return, Tab, Bell, etc. The vast majority can be emulated by pressing the Ctrl key in combination with another key. The ...


3

This may be easier to do with xmodmap. Put the following into your .xsession or .xinitrc: xmodmap -e "keysym Caps_Lock = Hyper_L" You will also need to make sure Hyper_L is assigned to a modifier map not shared with other keys, otherwise it may generate the modifier for those keys instead (or those keys may become Hyper). Run xmodmap with not parameters ...


3

Terminal line control can be queried and/or set by stty. To see the current settings, use stty -a. The manpages provide details. For example, from stty -a you might find this kill-line control: kill = ^U The caret means hold the control key (Ctrl) and then type the character shown (U). To change the line-kill sequence, you could do: $ stty kill \@ ...


3

The interface between a terminal application and a terminal emulator (or hardware terminal) transmits bytes, not keys. Function keys such as cursor movement keys are translated into escape sequences (beginning with the escape character ESC a.k.a. \e a.k.a. \033 a.k.a. 0x1b a.k.a. ^[). The same goes for combinations of a function key or a character key with ...


3

Keypresses in X have 8 modifier bits: Shift Lock Control Mod1 Mod2 Mod3 Mod4 Mod5 Any key can be bound to any of these modifiers, but (as you might imagine) typically the left/right Shift keys are bound to Shift, Caps Lock is bound to Lock, and left/right Ctrl are bound to Control. Conspicuously missing from the list is Alt, which is usually bound to ...


3

I think part of your solution starts with using the -K switch to rdesktop. -K Do not override window manager key bindings. By default rdesktop attempts to grab all keyboard input when it is in focus. patch Also I found this thread titled: Thread: rdesktop - ignore certain key combinationswhere one of the posters mentioned that he made a ...


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

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 ...



Only top voted, non community-wiki answers of a minimum length are eligible