Detect if plus sign (+) and equal sign (=) are located on the same keyboard key

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
john_c
Posts: 493
Joined: 05 May 2017, 13:19

Detect if plus sign (+) and equal sign (=) are located on the same keyboard key

03 Oct 2021, 05:28

This can be a silly question with poor wording, but is there a way to detect if the plus sign and equal sign are located on the same key?

* * *

On US keyboards, they are located on the same key. But as far as I know, it is not always the case: for example, on Italian keyboards, they are on different keys.

Why I'm asking this?

For example, if some app doesn't have shortcuts for zoom, I can find a workaround with AHK. And I would prefer to use Cotrol+Plus and Control+Minus for this. However, if I want my scripts to work flawlessly on different keyboards (English, Italian, Qwerty, Dvorak, ...), I need to think about issues such a following one (ahk v2, qwerty):

Code: Select all

; version 1. Works correctly on US keyboards
; Doesn't work correctly on Italian ones

^+::
^=::
^NumpadAdd:: {
  ...
}

Code: Select all

; version 2. Works correctly on both US and Italian keyboards,
; but pressing the Shift key on US keyboards may seem boring

^+:: ; It is assumed you press Ctrl+Shift+=
^NumpadAdd:: {
  ...
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: peter_ahk and 355 guests