m (Keymapper)
(xdotool to invoke the mouse middle click from the keyboard)
Line 32: Line 32:
 
Limitations:
 
Limitations:
  
I didn't figure out how to write outputs from programs, e.g., the current date (it doesn't understand <tt>/dev/tty</tt> or <tt>/dev/stdout</tt>, though it can output to tty but that's for terminals only).
+
I didn't figure out how to write outputs from programs, e.g., the current date (it doesn't understand <tt>/dev/tty</tt> or <tt>/dev/stdout</tt>, though it can output to tty but that's for terminals only). This should be possible with <tt>xdotool</tt> below:
 +
 
 +
== xdotool ==
 +
 
 +
'''''<tt>xdotool</tt>''''' is a computer program to simulate input devices, e.g., the keyboard or the mouse.
 +
 
 +
For instance, entering the following in a console
 +
<pre>
 +
xdotool click 2
 +
</pre>
 +
simulates the mouse middle-click, which is typically associated to paste from last selected content. So from adding this as a new command in <tt>shortcuts</tt> in [[KDE]]'s System Settings, one can emulate mapping the middle-click button to a keyboard key (in my case Ctrl+Shift+V)
 +
 
 +
# Ctrl+Shift+V clicks the mouse middle button (past last selected content)

Revision as of 16:58, 15 January 2025

Contents

Shortcut

A shortcut is what differentiate the expert from the dilettante, the genius from the laborious. Even the expert has to go through the long way home, occasionally, but their routine practice of the Art will take all the possible shortcuts.

Keyboards

I use keyboard shortcuts a lot, for instance, lw in krunner brings me to this web (like wp does for wikipedia or gg for google). This you can get with in Web Shortcuts (best defined from konqueror):

http://laussy.org/wiki/Special:Search?search=\{@}&go=Go

Keymapper

For general keyboard shortcuts, we use keymapper:

  1. Ctrl+Alt+P generates a <pre></pre> tag.
  2. Ctrl+Shift+Space generates an unbreakable space &nbsp;
  3. Ctrl+Alt+T generates a <tt></tt> tag
  4. Ctrl+Alt+W generates a wz <wz tip="">(?!)</wz> tag.
  5. Ctrl+Alt+Shift+W generates a <wz tagtotip=></wz><span id=""></span> tag.
  6. Ctrl+Alt+B opens by bibTeX file.
  7. Ctrl+Alt+R generates a == References ==<references /> section.
  8. Ctrl+Alt+N generates a <nowiki></nowiki> section.

The file to define the shortcuts is in ~/.config/keymapper.conf. The application runs with keymapper -u (where -u is for updating the rules from the file).

Discontinued:

  1. Ctrl+Alt+J generates a Julia snippet:
    <syntaxhighlight lang="python"></syntaxhighlight>
    which is actually python until I get support for julia.

Limitations:

I didn't figure out how to write outputs from programs, e.g., the current date (it doesn't understand /dev/tty or /dev/stdout, though it can output to tty but that's for terminals only). This should be possible with xdotool below:

xdotool

xdotool is a computer program to simulate input devices, e.g., the keyboard or the mouse.

For instance, entering the following in a console

xdotool click 2

simulates the mouse middle-click, which is typically associated to paste from last selected content. So from adding this as a new command in shortcuts in KDE's System Settings, one can emulate mapping the middle-click button to a keyboard key (in my case Ctrl+Shift+V)

  1. Ctrl+Shift+V clicks the mouse middle button (past last selected content)