Avoid typing backticks twice (on Linux and Windows) using the instructions below :)
-
-
Save keckelt/0ba90f8840e2903bfdc54c7e19ad4613 to your computer and use it in GitHub Desktop.
The backtick is called grave
If the backtick is not typed on your first keyboard button press, but on the second it is a dead grave
.
So, find the backtick button keycode for your layout:
xmodmap -pke | grep "grave"
which returns (for my german keyboard layout):
keycode 21 = dead_acute dead_grave dead_acute dead_grave
keycode 49 = dead_circumflex degree asciicircum degree U2032 U2033 notsign notsign grave asciitilde
keycode 51 = numbersign apostrophe numbersign apostrophe rightsinglequotemark dead_breve rightsinglequotemark grave backslash bar
The first entry (keycode 21) is the correct one (the one I physically use), with the acute (forwardtick?) and grave (backtick) symbols.
Both have a dead_
prefix, meaning they wait for another keypress.
So all you have to do, is to change the symbols for this keycode. I will keep the dead behaviour for acute (to write Café), but not for grave, so:
xmodmap -e 'keycode 21 = dead_acute grave'
Note that your keycode may be different (e.g., 49 on uk/us keyboards). If you want to have consistent behaviour, remove the dead prefix from acute aswell.
This AHK script inserts backticks directly and provides the dead key behaviour via CTRL+Backtick:
#SingleInstance force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Diable Backtick's dead key behaviour
;escape backtick with dollar sign ($`), send ecape backtick with backtick (``=`), send space to insert
$`::send ``{space}
; Provide dead key behaviour via CTRL+backtick
; if ctrl+backtick (^`), use normal dead key behaviour
^`::send ``
Happy to hear 😄