22 votes
Accepted

Typing quickly when Control, Alt and Esc are hard to reach

This is a hard question to "answer", but a few thoughts: Try working with the default key bindings for a while, because Emacs will definitely feel strange at first. I would not suggest making major ...
user avatar
  • 19.4k
21 votes
Accepted

Is there a mode for viewing keystroke lossage in realtime?

Addressing the last question in your post: you can get an auto-updating log of commands & key strokes by using https://github.com/lewang/command-log-mode which is also available on MELPA - by ...
user avatar
14 votes
Accepted

How to get keystrokes displayed in the echo area immediately?

You are looking to adjust the value of the variable echo-keystrokes. You can read its docstring by entering C-h v echo-keystrokes (or M-x describe-variable echo-keystrokes): Documentation: ...
user avatar
  • 31.1k
13 votes
Accepted

decrease time until "C-x-" shows in echo area after pressing the keys

(setq echo-keystrokes 0.01) will result in near-instantaneous echoing of the keystrokes. Alternatively, you could customize the variable (M-x customize-variable RET echo-keystrokes). The variable ...
user avatar
  • 1,911
10 votes

Typing quickly when Control, Alt and Esc are hard to reach

I've got myself for Christmas a Kinesis keyboard. I will not post links so that not to make this an advertisement. Keyboards with similar qualities will do too. Before that I had a Steelseries ...
user avatar
  • 10.9k
10 votes

Is there a mode for viewing keystroke lossage in realtime?

Yes. There's a package called mwe-log-commands, which is available in MELPA. Just run M-x mwe:log-keyboard-commands to start recording, then M-x mwe:open-command-log-buffer will open a buffer which ...
user avatar
  • 2,781
8 votes

Is there a mode for viewing keystroke lossage in realtime?

You can use a post-command-hook to update the lossage buffer. The following snippet does that for you (on a buffer local basis), but it assumes you've renamed the lossage buffer to "Lossage" (so this ...
user avatar
  • 22.4k
6 votes
Accepted

Is there a package that can bind S-S (shift-shift) to an interactive function?

Applications written with/for GUI frameworks such as X11 can generally receive individual key-up/key-down events, so it would be possible if only Emacs exposed that functionality to the land of Elisp, ...
user avatar
6 votes
Accepted

What is the key LFD?

LFD refers to "linefeed". This key is similar to return -- in ways not worth discussing here -- but can be input with C-j.
user avatar
  • 8,629
6 votes

Translating strings to keypresses

Does (execute-kbd-macro (kbd "Hello")) work by any chance?
user avatar
  • 10.1k
6 votes

How to repeat the last n keystrokes?

Emacs records the last 300 input events (mainly keystrokes, but also mouse clicks and such). In Elisp, you can access them by calling recent-keys. As a user, you can view the list of keystrokes by ...
user avatar
6 votes
Accepted

Making sure that a pair of functions is executed even if C-g is pressed in the middle

Based upon the comment of the original poster underneath the question, the function unwind-protect achieves the desired behavior. The doc-string and printout of the *Help* buffer for describe-...
user avatar
  • 17.8k
6 votes
Accepted

How to play back an edit session in emacs?

Bob is likely referring to the undo-browse.el package. According to the package's ub-introduction command, In ub terminology, the undo-history is seen as a movie, each step being a frame of the ...
user avatar
  • 3,925
6 votes
Accepted

Break key as a shortcut -- what am I doing wrong?

You ask several related questions, but this is the main one, I think: How does one find out what name emacs gives to a key such as the one labeled pause/break on my keyboard? For Emacs's description ...
user avatar
  • 70.3k
5 votes
Accepted

How to input '#' in Emacs with UK keyboard on Mac OS X?

There are other methods than the one mentioned in this answer, but I personally prefer the best of both worlds -- i.e., I use the left alt/option key as meta, and I use the right alt/option key for ...
user avatar
  • 17.8k
5 votes
Accepted

A function which acts differently depending on the last keystroke

You could take advantage of the recent-keys function. It returns a vector of the last 300 events. Using (defun get-last-key () (interactive) (let ((vect (recent-keys))) (aref vect (1- (...
user avatar
5 votes
Accepted

C-) not recognized on Windows 10

I found a solution—the following works for me: Control Panel > Language > Advanced Settings > Change language bar hot keys > Ensure Between input languages is highlighted > Change Key Sequence... ...
user avatar
  • 569
5 votes
Accepted

OA and OB inserted by emacs

In text terminals, many keys (like up) work by sending a sequence of bytes, such as ESC O A. Emacs normally recognizes these sequences and turns them into a more meaningful up event, using input-...
user avatar
  • 25.4k
4 votes

Typing quickly when Control, Alt and Esc are hard to reach

step 1, install evil-mode (http://www.emacswiki.org/emacs/Evil). It uses vim key bindings and provides advanced vim features like text objects, so you type much less Ctrl, Alt step 2, use evil-leader ...
user avatar
  • 4,631
4 votes
Accepted

How can I convert a C-key code into a 'normal' key code?

I think you want event-basic-type. E.g. (event-basic-type ?\C-;) returns ?;. If you want to only stop the control modifier but keep the other modifiers (e.g. the shift modifier), then you can try ...
user avatar
  • 25.4k
4 votes

Translating strings to keypresses

Okay, so my first answer has a number of shortcomings as detailed in its comments. execute-kbd-macro is a built-in function in C source code. (execute-kbd-macro MACRO &optional COUNT LOOPFUNC) ...
user avatar
  • 10.1k
4 votes
Accepted

Control+Meta key is not working

Checking the Ubuntu system-settings :System-settings->keyboard->shortcuts->navigation, shows that Ctrl+Alt+Left was bound to "Switch to workspace left" and Ctrl+Alt+Right was bound to "...
user avatar
4 votes

Is there an advantage to learning ESC- instead of ALT- beyond "maybe you'll use a system someday ..."?

Emacs has a lot of keybindings. I have never used a system where some Emacs keybindings did not clash with the underlying system. Every window manager intercepts a different set of keybindings, so the ...
user avatar
4 votes
Accepted

How to make emacs recognise C + SHIFT combinations in terminal mode?

You can't. There's no way for a terminal to communicate both control and shift modifiers. The very original terminals (teletypes, actually) implemented the control modifier by masking out the top two ...
user avatar
  • 12.2k
4 votes
Accepted

Abbreviation expansion without spaces

I asked the same question recently on emacs-devel and Kenichi Handa told me I could do: (defvar my-TeX-input-method-tweaked nil) (defun my-quail-activate-hook () (when (and (not (member (quail-name)...
user avatar
  • 25.4k
4 votes
Accepted

is there a keybinding to save curor position for returning after viewing other section of same buffer?

@Aaron answered well with the usual way to take care of this in Emacs: set a mark where you are now, then get back to it later using C-u C-SPC. Another way is to use a bookmark, in particular a ...
user avatar
  • 70.3k
4 votes

Display keybindings typed in a buffer

Yes! This is command-log-mode which can be installed from Melpa. You have to add the function to whatever modes you want to record, like (add-hook 'python-mode-hook 'command-log-mode) Then, to ...
user avatar
  • 895
3 votes

A function which acts differently depending on the last keystroke

(defun foo (keys) (interactive "kUse a key sequence: ") (let ((ks (this-single-command-keys))) (setq ks (aref ks (1- (length ks)))) (if (eq 'home ks) (message "yes") (message "no")))) ...
user avatar
  • 70.3k
3 votes

press keystroke sequence with elisp

(execute-kbd-macro (read-kbd-macro "<f11>")) As for the key sequence syntax see the edmacro-mode help (C-h f edmacro-mode). For example, it allows you to write: (execute-kbd-macro (read-kbd-...
user avatar
3 votes

Is there a mode for viewing keystroke lossage in realtime?

The lossage help buffer is not associated with a file on disk. Hence auto revert mode does not work. A pseudo realtime alternative can be using (open-dribble-file "FILE") which writes all keystrokes ...
user avatar
  • 3,836

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