Home > Software engineering >  How to send tilde or backtick in AutoHotkey using a Nordic keyboard layout?
How to send tilde or backtick in AutoHotkey using a Nordic keyboard layout?

Time:03-28

To bind AltGr , to tilde ~ and AltGr . to backtick ` I wrote this AutoHotkey script:

<^>!,:: Send, ~
<^>!.:: Send, ``

This works fine when using some keyboard layouts, for example the Italian one.

Some keyboard layouts, for example the Estonian and I believe other Nordic layouts as well, don't "fire" those symbols right away but require them to be pressed in combination with other keys. For example:

  • ~ SPACE produces ~
  • ~ o produces õ

With this kind of keyboard layouts the script I wrote requires the keys combination to be pressed twice and has the result of producing the symbols twice.

For example AltGr , , produces ~~

Is it possible to make the script work correctly, regardless of the keyboard layout used?

CodePudding user response:

This should work on all keyboards that use AltGr:

<^>!,:: Send {text}~
<^>!.:: Send {text}`` ; backtick must be escaped by another one

See Text mode in the documentation.

  • Related