Keyboard Key manage

Discuss the future of the AutoHotkey language
Archimede
Posts: 464
Joined: 25 Nov 2021, 09:49
Location: Switzerland / Italy

Keyboard Key manage

Post by Archimede » 06 Mar 2023, 04:48

Hallo.
For my development I studied very well the keyboard working; then I saw some things you no explain well on your manual.
If you are interested I can post here all my test and considerations (all well tested), but I must tell you that all are in Italian language (because I made all for me and fo my development).

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Keyboard Key manage

Post by swagfag » 06 Mar 2023, 04:57

whatever, post them. anyone can run a google translate on them

Archimede
Posts: 464
Joined: 25 Nov 2021, 09:49
Location: Switzerland / Italy

Re: Keyboard Key manage

Post by Archimede » 06 Mar 2023, 05:18

I post here a test function I made; there is a complex explanation that is too much difficult, for me, translate to English.
The function is correctly working, but I think the much interesting thing is the keyboard working explanation.

Code: Select all

Global VK_NUMLOCK                := 0x90         ; NUMLOCK
Global VK_SCROLL                 := 0x91         ; SCROLL LOCK
Global VK_CAPITAL                := 0x14         ; CAPITALS LOCK ( CAPS LOCK )
Global VK_LCONTROL               := 0xa2         ; LEFT CONTROL ( LEFT CTRL )
Global VK_RCONTROL               := 0xa3         ; RIGHT CONTROL ( RIGHT CTRL )
Global VK_LMENU                  := 0xa4         ; LEFT ALT
Global VK_RMENU                  := 0xa5         ; RIGHT ALT
Global VK_LSHIFT                 := 0xa0         ; LEFT SHIFT
Global VK_RSHIFT                 := 0xa1         ; RIGHT SHIFT
Global VK_LWIN                   := 0x5b         ; LEFT WIN
Global VK_RWIN                   := 0x5c         ; RIGHT WIN
Global VK_APPS                   := 0x5d         ; APPLICATIONS ( APPS )

/*
|==================================================================================================================================|
|                                                                                                                                  |
| MAPPA FUNZIONALE DI TUTTI I TASTI MODIFICATORI DELLA TASTIERA                                                                    |
|                                                                                                                                  |
|==================================================================================================================================|
|                                                                                                                                  |
| La tastiera, vista dal sistema, è semplicemente un insieme di pulsanti ognuno con un suo codice identificativo; quando un        |
| pulsante viene premuto è il sistema che, in base al codice identificativo del pulsante, assegna un particolare significato a     |
| tale pulsante.                                                                                                                   |
| Per ogni pulsante della tastiera il sistema riserva un bit di memoria: tale bit di memoria viene invertito ad ogni click di      |
| pulsante, memorizzando quindi l'ultima azione eseguita per ogni pulsante: è in questo modo che i pulsanti come NumLock oppure    |
| CapsLock mantengono efficace la loro azione anche dopo che sono stati premuti, fino al successivo click dello stesso pulsante: è |
| il sistema, quindi, che definisce completamente il funzionamento della tastiera.                                                 |
| Per quanto riguarda i tasti di azione immediata ( i tasti carattere per esempio ) è sempre il sistema che identifica il codice   |
| del tasto premuto e, pur memorizzando l'inversione di stato per tale tasto, non ne tiene conto e stampa immediatamente un        |
| carattere corrispondente al codice di tasto premuto identificato ( per i tasti di movimento il comportamento è molto simile: non |
| stampa nessun carattere ma effettua il movimento corrispondnete al codice di tasto identificato ).                               |
| Questa funzione legge i valori a livello di sistema, non legge i codici di ogni tasto della tastiera.                            |
| Questa funzione legge e riporta la posizione fisica ed il valore di tutti i tasti modificatori della tastiera: per fare ciò      |
| utilizza la funzione API GetKeyState(...) una volta per ogni tasto da rilevare.                                                  |
| Per posizione fisica si intende se al momento del test il tasto è premuto ( 1 ) oppure non premuto ( 0 );                        |
| per valore si intende il valore memorizzato tramite le precedenti pressioni del tasto: ogni singolo tasto modificatore ogni      |
| volta che viene premuto setta ( 1 ) o resetta ( 0 ) un suo valore all'interno della tastiera: tale valore rimane memorizzato     |
| nella memoria relativa alla tastiera fino al successivo click dello stesso tasto ( effetto Toggle ).                             |
| Anche i tasti ad azione immediata vengono gestiti allo stesso modo, ma sono invece soggetti ad un bug più sotto riportato;       |
| poiché tali tasti non vengono rilevati da questa funzione il problema è quasi trascurabile, fatta eccezione per il tasto INS     |
| che, contrariamente a quanto si crede, non è un tasto modificatore ( si nota che non è un tasto modificatore in quanto ha        |
| effetto indipendente in ogni programma in cui agisce la tastiera ).                                                              |
|                                                                                                                                  |
| In base ai test effettuati, esiste una sola memoria di sistema per tutte le tastiere collegate ( anche se sono collegate 2 o più |
| tastiere contemporaneamente: in tale caso è come se fosse collegata una sola tastiera con molti tasti indistinguibili da         |
| tastiera a tastiera ): è quindi possibile, per esempio, premere il tasto SHIFT su una tastiera ed il tasto l su un'altra         |
| tastiera per ottenere il carattere L: questo implica, anche, che i valori ritornati da questa funzione sono relativi ad una      |
| tastiera solamente se esiste una sola tastiera connessa al computer: viceversa, se sono collegate più tastiere, i valori         |
| ritornati da questa funzione sono relativi a tutte le tastiere contemporaneamente.                                               |
| Una visualizzazione chiara di questo effetto si ha tramite il tasto CAPS LOCK: se si preme tale tasto su una tastiera esso       |
| modifica l'accensione o spegnimento del LED relativo a tale tasto anche su tutte le altre tastiere.                              |
| In pratica, il set definito durante l'uso di una tastiera è valido anche per tutte le altre tastiere eventualmente collegate, e  |
| può essere da ognuna modificato in qualsiasi momento utilizzando i suoi tasti, rimanendo comunque valido per tutte le tastiere   |
| collegate.                                                                                                                       |
|                                                                                                                                  |
| Tutti i tasti hanno realmente 2 valori binari indipendenti, entrambi gestiti dal Sistema Operativo e memorizzati nella memoria   |
| relativa alla tastiera:                                                                                                          |
| - valore istantaneo al momento del test ( 0 oppure 1 a seconda che il tasto sia non premuto oppure premuto, rispettivamente, al  |
|   momento del test );                                                                                                            |
| - valore Toggle, INVERTITO ad ogni click del tasto; all'avviamento del programma di test e al momento del test tale valore può   |
|   essere 0 oppure 1 ( perché non si sa se tale tasto è stato premuto in precedenza e quindi se ha invertito il suo valore        |
|   Toggled ); in pratica la modifica di questo valore indica che nel frattempo, dopo il precedente test, il tasto è stato premuto |
|   un numero dispari di volte, almeno 1, anche se al momento del test il tasto non è premuto;                                     |
| - mantenere premuto un tasto provocando ripetizione automatica non genera l'inversione automatica del livello Toggle di tale     |
|   tasto, ma mantiene sempre e comunque il livello Toggle uguale al valore generato al momento del click sul tasto: sia il        |
|   livello sia il valore Toggle si riferiscono al click fisico sul tasto, NON all'effetto che esso provoca ( la generazione di un |
|   carattere, lo spostamento del cursore o altro );                                                                               |
| - i tasti modificatori memorizzano il loro valore Toggle nella memoria relativa alla tastiera e quindi il loro valore è sempre   |
|   uguale in tutti i programmi in cui la tastiera funziona;                                                                       |
| - BUG: per i tasti di azione immediata ( per esempio un normale tasto lettera alfabetica, ma anche INS ), a partire              |
|   dall'avviamento del programma di test, fino a quando non viene effettuato il primo click del pulsante, eventuali test del      |
|   valore memorizzato ritornano sempre 0 anche se il valore reale è 1: tale valore reale verrà correttamente rilevato dal         |
|   successivo click del tasto in poi e da allora potrà essere correttamente testato; poiché il valore iniziale di Toggle per ogni |
|   tasto può essere 0 oppure 1, non è possibile determinare tale valore PRIMA del primo click di tale tasto; invece il test       |
|   effettuato immediatamente dopo il primo click ritorna il valore reale di Toggle, e da allora in poi tutti i click di tale      |
|   valore ritorneranno il risultato esatto.                                                                                       |
|   La funzione GetKeyState( ..., T ) è soggetta questo bug poiché legge questo stesso valore.                                     |
|   I tasti sicuramente NON soggetti a questo bug sono i seguenti:                                                                 |
|   NUMLOCK                                                                                                                        |
|   SCROLLLOCK                                                                                                                     |
|   CAPITALSLOCK                                                                                                                   |
|   LEFTCONTROL                                                                                                                    |
|   RIGHTCONTROL                                                                                                                   |
|   LEFTALT                                                                                                                        |
|   RIGHTALT                                                                                                                       |
|   LEFTSHIFT                                                                                                                      |
|   RIGHTSHIFT                                                                                                                     |
|   LEFTWIN                                                                                                                        |
|   RIGHTWIN                                                                                                                       |
|   APPS                                                                                                                           |
|   ESCAPE                                                                                                                         |
|   ENTER                                                                                                                          |
|   BACKSPACE                                                                                                                      |
|   TAB                                                                                                                            |
| - la ripetizione automatica, che esiste per i tasti di carattere, di spostamento e altri, è gestita completamente dal sistema.   |
|                                                                                                                                  |
| I tasti modificatori di stato sono tutti quelli che da soli non agiscono ma modificano il funzionamento della tastiera tramite i |
| tasti che invece agiscono ( per esempio il tasto CAPS LOCK fa in modo che i successivi tadsti carattere digitati sulla tastiera  |
| vengano considerati come lettere in minuscole oppure maiuscole ).                                                                |
| In caso di tasti doppi ( come per esempio CONTROL, di cui normalmente esistono 2 tasti, uno a sinistra e uno a destra ), la      |
| memoria di sistema relativa alla tastiera ha 1 bit per ogni singolo tasto modificatore sia sinistro che destro, invertendo il    |
| valore di tale bit ad ogni click di ogni singolo tasto: in questo modo ad ogni click di ogni singolo tasto modificatore viene    |
| invertito lo stato del corrispondente bit; questa funzione legge i singoli bit di memorizzazione di ogni tasto modificatore ( e  |
| quindi, nel caso in esempio, viene letto il valore memorizzato di LEFT CONTROL ed il valore memorizzato di RIGHT CONTROL ),      |
| oltre al valore istantaneo dei singoli tasti.                                                                                    |
| I tasti modificatori rilevati sono:                                                                                              |
| NUM LOCK                                                                                                                         |
| SCROLL LOCK                                                                                                                      |
| CAPS LOCK                                                                                                                        |
| LEFT CTRL                                                                                                                        |
| RIGHT CTRL                                                                                                                       |
| LEFT ALT                                                                                                                         |
| RIGHT ALT                                                                                                                        |
| LEFT SHIFT                                                                                                                       |
| RIGHT SHIFT                                                                                                                      |
| LEFT WIN                                                                                                                         |
| RIGHT WIN                                                                                                                        |
| APPS                                                                                                                             |
| ALT GR      : questo tasto ( ALTernate GRaphic ), se presente nella tastiera, viene gestito dalla tastiera come il click         |
|               contemporaneo LEFT CONTROL + RIGHT ALT ( cioè, in breve, sostituisce Ctrl + Alt ), provocando tutti gli effetti di |
|               tale azione: se al momento della chiamata di questa funzione è premuto ALT GR, i valori istantanei di LEFT CONTROL |
|               e RIGHT ALT corripondono a 1; inoltre il click ALT GR inverte contemporaneamente i singoli valori memorizzati di   |
|               LEFT CONTROL e di RIGHT ALT.                                                                                       |
|               Questo tasto, quindi, non ha un corrispondente valore identificativo ma il click di questo tasto deve essere       |
|               dedotto dalla lettura dei valori istantanei e di quelli memorizzati di LEFT CLICK e RIGHT ALT.                     |
| - I primi 3 tasti ( NUM LOCK, SCROLL LOCK, CAPS LOCK, modificatori di stato ) hanno l'evidente caratteristica sulla tastiera di  |
|   avere un LED che visualizza il loro stato attivo: quando il LED è acceso significa che il valore memorizzato è attivo ( 1 )    |
|   e l'effetto è permanente anche se il tasto non viene più premuto ( per esempio CAPS LOCK: una volta premuto e rilasciato       |
|   cambia i successivi caratteri alfabetici digitati da minuscoli a maiuscoli o viceversa );                                      |
| - i successivi tasti modificatori ( sono considerati singolarmente, uno per uno, anche i tasti doppi come LEFT CONTROL e         |
|   RIGHT CONTROL ) non hanno LED sulla tastiera, e, anche se hanno un funzionamento tecnico IDENTICO ai primi 3 tasti,            |
|   normalmente non vengono considerati per il loro valore memorizzato ma vengono considerati solo per il loro valore istantaneo   |
|   di click ( modificatori attivi ): in pratica vengono considerati dal sistema e dai programmi solo se sono già premuti al       |
|   momento del click di un altro tasto di funzionamento immediato ( per esempio un tasto carattere alfabetico ); il loro valore   |
|   memorizzato ( toggled ) normalmente non viene considerato anche se esiste ed è memorizzato nella memoria di sistema relativa   |
|   alla tastiera, e come tale viene letto da questa funzione.                                                                     |
|                                                                                                                                  |
| Questa funzione presuppone la definizione esterna delle seguenti variabili globali, definite nel file AHKHID.ahk versione        |
| Extended ( e nel file Costanti.ahk, che contiene tutti i Virtual key ) che è possibile includere tramite la direttiva            |
| #Include ...\AHKHID.ahk:                                                                                                         |
| VK_NUMLOCK := 0x90                         ; NUMLOCK ( keyboard hardware management )                                            |
| VK_SCROLL := 0x91                          ; SCROLL LOCK ( keyboard hardware management )                                        |
| VK_CAPITAL := 0x14                         ; CAPITALS LOCK ( CAPS LOCK ) ( keyboard hardware management )                        |
| VK_LCONTROL := 0xa2                        ; LEFT CONTROL ( LEFT CTRL ) ( keyboard hardware management )                         |
| VK_RCONTROL := 0xa3                        ; RIGHT CONTROL ( RIGHT CTRL ) ( keyboard hardware management )                       |
| VK_LMENU := 0xa4                           ; LEFT ALT ( keyboard hardware management )                                           |
| VK_RMENU := 0xa5                           ; RIGHT ALT ( keyboard hardware management )                                          |
| VK_LSHIFT := 0xa0                          ; LEFT SHIFT ( keyboard hardware management )                                         |
| VK_RSHIFT := 0xa1                          ; RIGHT SHIFT ( keyboard hardware management )                                        |
| VK_LWIN := 0x5b                            ; LEFT WIN ( keyboard hardware management )                                           |
| VK_RWIN := 0x5c                            ; RIGHT WIN ( keyboard hardware management )                                          |
| VK_APPS := 0x5d                            ; APPLICATIONS ( APPS ) ( keyboard hardware management )                              |
|                                                                                                                                  |
| ARGOMENTI:                                                                                                                       |
|                                                                                                                                  |
| RITORNA:                                                                                                                         |
| Stringa di bit ( non numero binario ) in cui ogni bit rappresenta un valore relativo ad un tasto; un bit è rappresentato dal     |
| valore 0 oppure 1 all'interno della stringa; l'ordinamento parte dal primo bit corrispondente al primo carattere a DESTRA nella  |
| stringa.                                                                                                                         |
| La stringa è composta da 2 serie di 12 bit per un totale di 24 bit, cioè 24 caratteri, di cui ognuno può rappresentare 0         |
| oppure 1; esempio reale:                                                                                                         |
| 100010110100000000000000                                                                                                         |
| a partire da destra, il primo set di 12 bit rappresenta il livello di ogni tasto modificatore al momento del test ( tasto        |
| premuto = 1, tasto non premuto = 0 ), il secondo set di 12 bit rappresenta il valore Toggle ( vedi descrizione sopra ) di ogni   |
| tasto modificatore.                                                                                                              |
| Bit posizione 24: valore memorizzato di NUM LOCK ( 0 NumLock non attivo; 1 NumLock attivo )                                      |
| Bit posizione 23: valore memorizzato di SCROLL LOCK ( 0 ScrollLock non attivo; 1 ScrollLock attivo )                             |
| Bit posizione 22: valore memorizzato di CAPS LOCK ( 0 CapsLock non attivo; 1 CapsLock attivo )                                   |
| Bit posizione 21: valore memorizzato di LEFT CTRL                                                                                |
| Bit posizione 20: valore memorizzato di RIGHT CTRL                                                                               |
| Bit posizione 19: valore memorizzato di LEFT ALT                                                                                 |
| Bit posizione 18: valore memorizzato di RIGHT ALT                                                                                |
| Bit posizione 17: valore memorizzato di LEFT SHIFT                                                                               |
| Bit posizione 16: valore memorizzato di RIGHT SHIFT                                                                              |
| Bit posizione 15: valore memorizzato di LEFT WIN                                                                                 |
| Bit posizione 14: valore memorizzato di RIGHT WIN                                                                                |
| Bit posizione 13: valore memorizzato di APPS                                                                                     |
| Bit posizione 12: livello tasto NUM LOCK                                                                                         |
| Bit posizione 11: livello tasto SCROLL LOCK                                                                                      |
| Bit posizione 10: livello tasto CAPS LOCK                                                                                        |
| Bit posizione 09: livello tasto LEFT CTRL                                                                                        |
| Bit posizione 08: livello tasto RIGHT CTRL                                                                                       |
| Bit posizione 07: livello tasto LEFT ALT                                                                                         |
| Bit posizione 06: livello tasto RIGHT ALT                                                                                        |
| Bit posizione 05: livello tasto LEFT SHIFT                                                                                       |
| Bit posizione 04: livello tasto RIGHT SHIFT                                                                                      |
| Bit posizione 03: livello tasto LEFT WIN                                                                                         |
| Bit posizione 02: livello tasto RIGHT WIN                                                                                        |
| Bit posizione 01: livello tasto APPS                                                                                             |
|                                                                                                                                  |
|==================================================================================================================================|
*/
Last edited by Archimede on 06 Mar 2023, 10:25, edited 2 times in total.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Keyboard Key manage

Post by swagfag » 06 Mar 2023, 06:29

FUNCTIONAL MAP OF ALL KEYBOARD MODIFIER KEYS
The keyboard, as seen by the system, is simply a set of buttons each with its own identification code; when a button is pressed, it is the system that, based on the button's identification code, assigns a particular meaning to that button.

For each button on the keyboard, the system reserves a memory bit: this memory bit is inverted with each click of a button, thus storing the last action performed for each button: this is how buttons such as NumLock or CapsLock keep their action effective even after they have been pressed, until the next click of the same button: it is the system, then, that completely defines the operation of the keyboard.

As for immediate action keys (character keys for example) it is always the system that identifies the code of the key pressed and, while storing the state inversion for that key, disregards it and immediately prints a character corresponding to the identified key pressed code (for motion keys the behavior is very similar: it does not prints any character but performs the movement corresponding to the identified key code).

This function reads system-wide values; it does not read the codes for each key on the keyboard.

This function reads and reports the physical position and value of all modifier keys on the keyboard: to do this it uses the API function GetKeyState(...) once for each key to be detected.

Physical position means whether at the time of the test the key is pressed (1) or not pressed (0); value means the value stored through previous key presses: each individual modifier key each time it is pressed sets (1) or resets (0) a value of its own within the keyboard: this value remains stored in memory relative to the keyboard until the next click of the same key (Toggle effect).

Immediate-action keys are also handled in the same way, but are instead subject to a bug further below; since these keys are not detected by this function the problem is almost negligible, except for the INS key, which, contrary to popular belief, is not a modifier key (note that it is not a modifier key since it has independent effect in each program in which the keyboard acts).
According to the tests performed, there is only one system memory for all connected keyboards (even if 2 or more keyboards are connected at the same time: in such a case, it is as if only one keyboard with many keys indistinguishable from keyboard to keyboard were connected): it is therefore possible, for example, to press the SHIFT key on one keyboard and the l key on another keyboard to obtain the character L: this implies, also, that the values returned by this function are relative to a keyboard only if there is only one keyboard connected to the computer: conversely, if multiple keyboards are connected, the values returned by this function are relative to all keyboards simultaneously.

A clear visualization of this effect is through the CAPS LOCK key: if you press this key on one keyboard it changes the switching on or off of the LED related to that key on all other keyboards as well.

In practice, the set defined while using one keyboard is also valid for all other possibly connected keyboards, and can be changed by each one at any time using its keys, while still remaining valid for all connected keyboards.
All keys really have 2 independent binary values, both of which are managed by the Operating System and stored in the memory related to the keyboard:
  • Instantaneous value at the time of the test (0 or 1 depending on whether the key is not pressed or pressed, respectively, at the time of the test);
  • Toggle value, INVERTED each time the key is clicked; at the start of the test program and at the time of the test, this value can be 0 or 1 (because it is not known whether such a key has been pressed previously and therefore whether it has inverted its Toggled value); in practice, changing this value indicates that in the meantime, since the previous test, the key has been pressed an odd number of times, at least 1, even if at the time of the test the key is not pressed;
  • holding down a key causing automatic repetition does not generate automatic reversal of the Toggle level of that key, but always keeps the Toggle level equal to the value generated at the time of the key click: both the level and the Toggle value refer to the physical click on the key, NOT to the effect it causes (the generation of a character, the movement of the cursor, or other);
  • modifier keys store their Toggle value in memory relative to the keyboard, and therefore their value is always the same in all programs in which the keyboard operates;
  • BUG: for immediate action keys (e.g., a normal alphabetic letter key, but also INS), starting from the start of the test program, until the first button click is made, any tests of the stored value always return 0 even if the actual value is 1: that actual value will be correctly detected from the next button click onward and can be correctly tested from then on; since the initial value of Toggle for each button can be either 0 or 1, it is not possible to determine that value BEFORE the first click of that button; instead, the test performed immediately after the first click returns the actual value of Toggle, and from then on all clicks of that value will return the exact result.

    The GetKeyState(..., T) function is subject to this bug since it reads this same value.
    The keys definitely NOT subject to this bug are the following:
    NUMLOCK
    SCROLLLOCK
    CAPITALSLOCK
    LEFTCONTROL
    RIGHTCONTROL
    LEFTALT
    RIGHTALT
    LEFTSHIFT
    RIGHTSHIFT
    LEFTWIN
    RIGHTWIN
    APPS
    ESCAPE
    ENTER
    BACKSPACE
    TAB
  • automatic repetition, which exists for character keys, shift keys, and others, is handled completely by the system.
State modifier keys are all those that by themselves do not act but modify the operation of the keyboard by keys that do act (e.g., the CAPS LOCK key causes the next tadsti character typed on the keyboard to be considered lowercase or uppercase letters).

In the case of duplicate keys (such as CONTROL, for example, of which there are normally 2 keys, one on the left and one on the right), the system memory relative to the keyboard has 1 bit for each individual modifier key both left and right, reversing the value of that bit with each click of each individual key: in this way at each click of each individual modifier key the state of the corresponding bit is inverted; this function reads the individual storage bits of each modifier key (and thus, in the case in example, the stored value of LEFT CONTROL and the stored value of RIGHT CONTROL are read), as well as the instantaneous value of the individual keys.

The detected modifier keys are:
NUM LOCK
SCROLL LOCK
CAPS LOCK
LEFT CTRL
RIGHT CTRL
LEFT ALT
RIGHT ALT
LEFT SHIFT
RIGHT SHIFT
LEFT WIN
RIGHT WIN
APPS
ALT GR : This key (ALTernate GRaphic), if present in the keyboard, is handled by the keyboard in the same way as the simultaneous LEFT CONTROL + RIGHT ALT click (i.e., in short, it replaces Ctrl + Alt), causing all the effects of that action: if ALT GR is pressed at the time this function is called, the instantaneous values of LEFT CONTROL and RIGHT ALT correspond to 1; in addition, the ALT GR click simultaneously reverses the individual stored values of LEFT CONTROL and RIGHT ALT.

This key, therefore, has no corresponding identifying value, but the click of this key must be deduced from the reading of the instantaneous and stored values of LEFT CLICK and RIGHT ALT.

  • The first 3 keys (NUM LOCK, SCROLL LOCK, CAPS LOCK, state modifiers) have the obvious feature on the keyboard of having an LED that displays their active state: when the LED is lit, it means that the stored value is active (1) and the effect is permanent even if the key is no longer pressed (e.g. CAPS LOCK: once pressed and released, it changes the next typed alphabetic characters from lower case to upper case or vice versa);
  • subsequent modifier keys (double keys such as LEFT CONTROL and RIGHT CONTROL are also considered individually, one by one) have no LEDs on the keyboard, and, although they have a technical operation IDENTICAL to the first 3 keys, they are normally not considered for their stored value but are considered only for their instantaneous click value (active modifiers): in practice they are considered by the system and programs only if they are already pressed at the time of the click of another key of instantaneous operation (e.g., an alphabetic character key); their stored (toggled) value is normally not considered even though it exists and is stored in system memory related to the keyboard, and as such is read by this function.
This function assumes the external definition of the following global variables, defined in the file AHKHID.ahk Extended version (and in the file Constants.ahk, which contains all Virtual keys), which you can include via the directive:

Code: Select all

#Include ...\AHKHID.ahk:
VK_NUMLOCK := 0x90                         ; NUMLOCK (keyboard hardware management)
VK_SCROLL := 0x91                          ; SCROLL LOCK (keyboard hardware management)
VK_CAPITAL := 0x14                         ; CAPITALS LOCK (CAPS LOCK) (keyboard hardware management)
VK_LCONTROL := 0xa2                        ; LEFT CONTROL (LEFT CTRL) (keyboard hardware management)
VK_RCONTROL := 0xa3                        ; RIGHT CONTROL (RIGHT CTRL) (keyboard hardware management)
VK_LMENU := 0xa4                           ; LEFT ALT (keyboard hardware management)
VK_RMENU := 0xa5                           ; RIGHT ALT (keyboard hardware management)
VK_LSHIFT := 0xa0                          ; LEFT SHIFT (keyboard hardware management)
VK_RSHIFT := 0xa1                          ; RIGHT SHIFT (keyboard hardware management)
VK_LWIN := 0x5b                            ; LEFT WIN (keyboard hardware management)
VK_RWIN := 0x5c                            ; RIGHT WIN (keyboard hardware management)
VK_APPS := 0x5d                            ; APPLICATIONS (APPS) (keyboard hardware management)
ARGUMENTS:

RETURN:
String of bits (not binary number) in which each bit represents a value relative to a key; a bit is represented by the value 0 or 1 within the string; sorting starts from the first bit corresponding to the first character on the RIGHT in the string.

The string consists of 2 sets of 13 bits for a total of 28 bits, i.e. 28 characters, of which each can represent 0 or 1; real example:
1000101101001000000000000000

starting from the right, the first set of 14 bits represents the level of each modifier key at the time of the test (key pressed = 1, key not pressed = 0), the second set of 14 bits represents the Toggle value (see description above) of each modifier key.

Bit position 24: stored value of NUM LOCK (0 NumLock not active; 1 NumLock active)
Bit position 23: stored value of SCROLL LOCK (0 ScrollLock not active; 1 ScrollLock active)
Bit position 22: stored value of CAPS LOCK (0 CapsLock not active; 1 CapsLock active)
Bit position 21: stored value of LEFT CTRL
Bit position 20: stored value of RIGHT CTRL
Bit position 19: stored value of LEFT ALT
Bit position 18: stored value of RIGHT ALT
Bit position 17: stored value of LEFT SHIFT
Bit position 16: stored value of RIGHT SHIFT
Bit position 15: stored value of LEFT WIN
Bit position 14: stored value of RIGHT WIN
Bit position 13: stored value of APPS
Bit position 12: NUM LOCK key level
Bit position 11: SCROLL LOCK key level
Bit position 10: CAPS LOCK key level.
Bit position 09: LEFT CTRL key level
Bit position 08: RIGHT CTRL key level.
Bit position 07: key level LEFT ALT
Bit position 06: RIGHT ALT key level
Bit position 05: LEFT SHIFT key level
Bit position 04: RIGHT SHIFT key level
Bit position 03: LEFT WIN key level
Bit position 02: RIGHT WIN key level
Bit position 01: APPS key level

Archimede
Posts: 464
Joined: 25 Nov 2021, 09:49
Location: Switzerland / Italy

Re: Keyboard Key manage

Post by Archimede » 06 Mar 2023, 19:10

If you like I can post all virtual key constants.

zelvap
Posts: 4
Joined: 25 Nov 2021, 19:52

Re: Keyboard Key manage

Post by zelvap » 25 Apr 2023, 05:30

Archimede wrote:
06 Mar 2023, 19:10
If you like I can post all virtual key constants.
Yes please

Archimede
Posts: 464
Joined: 25 Nov 2021, 09:49
Location: Switzerland / Italy

Re: Keyboard Key manage

Post by Archimede » 23 May 2023, 02:36

Code: Select all

; DEFINIZIONE CODICI VIRTUAL KEY PER OGNI TASTO DELLA TASTIERA =====================================================================
; https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

Global VK_LBUTTON                := 0x01         ; Left mouse button
Global VK_RBUTTON                := 0x02         ; Right mouse button
Global VK_CANCEL                 := 0x03         ; Control-break processing
Global VK_MBUTTON                := 0x04         ; Middle mouse button (three-button mouse)
Global VK_XBUTTON1               := 0x05         ; X1 mouse button
Global VK_XBUTTON2               := 0x06         ; X2 mouse button
Global VK_BACK                   := 0x08         ; BACKSPACE
Global VK_TAB                    := 0x09         ; TAB
Global VK_CLEAR                  := 0x0c         ; CLEAR
Global VK_RETURN                 := 0x0d         ; ENTER
Global VK_SHIFT                  := 0x10         ; SHIFT
Global VK_CONTROL                := 0x11         ; CONTROL
Global VK_MENU                   := 0x12         ; ALT
Global VK_PAUSE                  := 0x13         ; PAUSE
Global VK_CAPITAL                := 0x14         ; CAPITALS LOCK ( CAPSLOCK )
Global VK_KANA                   := 0x15         ; IME Kana or IME Hangul mode
Global VK_IME_ON                 := 0x16         ; IME On
Global VK_JUNJA                  := 0x17         ; IME Junja mode
Global VK_FINAL                  := 0x18         ; IME final mode
Global VK_HANJA                  := 0x19         ; IME Hanja or IME Kanji mode
Global VK_IME_OFF                := 0x1a         ; IME Off
Global VK_ESCAPE                 := 0x1b         ; ESCAPE ( ESC )
Global VK_CONVERT                := 0x1c         ; IME convert
Global VK_NONCONVERT             := 0x1d         ; IME nonconvert
Global VK_ACCEPT                 := 0x1e         ; IME accept
Global VK_MODECHANGE             := 0x1f         ; IME mode change request
Global VK_SPACE                  := 0x20         ; SPACEBAR
Global VK_PRIOR                  := 0x21         ; PAGE UP
Global VK_NEXT                   := 0x22         ; PAGE DOWN
Global VK_END                    := 0x23         ; END
Global VK_HOME                   := 0x24         ; HOME
Global VK_LEFT                   := 0x25         ; LEFT ARROW
Global VK_UP                     := 0x26         ; UP ARROW
Global VK_RIGHT                  := 0x27         ; RIGHT ARROW
Global VK_DOWN                   := 0x28         ; DOWN ARROW
Global VK_SELECT                 := 0x29         ; SELECT
Global VK_PRINT                  := 0x2a         ; PRINT
Global VK_EXECUTE                := 0x2b         ; EXECUTE
Global VK_SNAPSHOT               := 0x2c         ; PRINT SCREEN ( PRTSCR )
Global VK_INSERT                 := 0x2d         ; INSERT ( INS )
Global VK_DELETE                 := 0x2e         ; DELETE ( DEL )
Global VK_HELP                   := 0x2f         ; HELP
Global VK_0                      := 0x30         ; 0
Global VK_1                      := 0x31         ; 1
Global VK_2                      := 0x32         ; 2
Global VK_3                      := 0x33         ; 3
Global VK_4                      := 0x34         ; 4
Global VK_5                      := 0x35         ; 5
Global VK_6                      := 0x36         ; 6
Global VK_7                      := 0x37         ; 7
Global VK_8                      := 0x38         ; 8
Global VK_9                      := 0x39         ; 9
Global VK_A                      := 0x41         ; a
Global VK_B                      := 0x42         ; b
Global VK_C                      := 0x43         ; c
Global VK_D                      := 0x44         ; d
Global VK_E                      := 0x45         ; e
Global VK_F                      := 0x46         ; f
Global VK_G                      := 0x47         ; g
Global VK_H                      := 0x48         ; h
Global VK_I                      := 0x49         ; i
Global VK_J                      := 0x4a         ; j
Global VK_K                      := 0x4b         ; k
Global VK_L                      := 0x4c         ; l
Global VK_M                      := 0x4d         ; m
Global VK_N                      := 0x4e         ; n
Global VK_O                      := 0x4f         ; o
Global VK_P                      := 0x50         ; p
Global VK_Q                      := 0x51         ; q
Global VK_R                      := 0x52         ; r
Global VK_S                      := 0x53         ; s
Global VK_T                      := 0x54         ; t
Global VK_U                      := 0x55         ; u
Global VK_V                      := 0x56         ; v
Global VK_W                      := 0x57         ; w
Global VK_X                      := 0x58         ; x
Global VK_Y                      := 0x59         ; y
Global VK_Z                      := 0x5a         ; z
Global VK_LWIN                   := 0x5b         ; Left Windows key (Natural keyboard)
Global VK_RWIN                   := 0x5c         ; Right Windows key (Natural keyboard)
Global VK_APPS                   := 0x5d         ; APPLICATIONS ( APPS )
Global VK_SLEEP                  := 0x5f         ; Computer Sleep key
Global VK_NUMPAD0                := 0x60         ; Numeric keypad 0
Global VK_NUMPAD1                := 0x61         ; Numeric keypad 1
Global VK_NUMPAD2                := 0x62         ; Numeric keypad 2
Global VK_NUMPAD3                := 0x63         ; Numeric keypad 3
Global VK_NUMPAD4                := 0x64         ; Numeric keypad 4
Global VK_NUMPAD5                := 0x65         ; Numeric keypad 5
Global VK_NUMPAD6                := 0x66         ; Numeric keypad 6
Global VK_NUMPAD7                := 0x67         ; Numeric keypad 7
Global VK_NUMPAD8                := 0x68         ; Numeric keypad 8
Global VK_NUMPAD9                := 0x69         ; Numeric keypad 9
Global VK_MULTIPLY               := 0x6a         ; Multiply ( * )
Global VK_ADD                    := 0x6b         ; Add ( + )
Global VK_SEPARATOR              := 0x6c         ; Separator
Global VK_SUBTRACT               := 0x6d         ; Subtract ( - )
Global VK_DECIMAL                := 0x6e         ; Decimal ( . )
Global VK_DIVIDE                 := 0x6f         ; Divide ( / )
Global VK_F1                     := 0x70         ; F1
Global VK_F2                     := 0x71         ; F2
Global VK_F3                     := 0x72         ; F3
Global VK_F4                     := 0x73         ; F4
Global VK_F5                     := 0x74         ; F5
Global VK_F6                     := 0x75         ; F6
Global VK_F7                     := 0x76         ; F7
Global VK_F8                     := 0x77         ; F8
Global VK_F9                     := 0x78         ; F9
Global VK_F10                    := 0x79         ; F10
Global VK_F11                    := 0x7a         ; F11
Global VK_F12                    := 0x7b         ; F12
Global VK_F13                    := 0x7c         ; F13
Global VK_F14                    := 0x7d         ; F14
Global VK_F15                    := 0x7e         ; F15
Global VK_F16                    := 0x7f         ; F16
Global VK_F17                    := 0x80         ; F17
Global VK_F18                    := 0x81         ; F18
Global VK_F19                    := 0x82         ; F19
Global VK_F20                    := 0x83         ; F20
Global VK_F21                    := 0x84         ; F21
Global VK_F22                    := 0x85         ; F22
Global VK_F23                    := 0x86         ; F23
Global VK_F24                    := 0x87         ; F24
Global VK_NUMLOCK                := 0x90         ; NUMLOCK
Global VK_SCROLL                 := 0x91         ; SCROLL LOCK ( SCRL LCK )
Global VK_LSHIFT                 := 0xa0         ; LEFT SHIFT
Global VK_RSHIFT                 := 0xa1         ; RIGHT SHIFT
Global VK_LCONTROL               := 0xa2         ; LEFT CONTROL ( LEFT CTRL )
Global VK_RCONTROL               := 0xa3         ; RIGHT CONTROL ( RIGHT CTRL )
Global VK_LMENU                  := 0xa4         ; LEFT ALT
Global VK_RMENU                  := 0xa5         ; RIGHT ALT
Global VK_BROWSER_BACK           := 0xa6         ; Browser Back
Global VK_BROWSER_FORWARD        := 0xa7         ; Browser Forward
Global VK_BROWSER_REFRESH        := 0xa8         ; Browser Refresh
Global VK_BROWSER_STOP           := 0xa9         ; Browser Stop
Global VK_BROWSER_SEARCH         := 0xaa         ; Browser Search
Global VK_BROWSER_FAVORITES      := 0xab         ; Browser Favorites
Global VK_BROWSER_HOME           := 0xac         ; Browser Start and Home
Global VK_VOLUME_MUTE            := 0xad         ; Volume Mute
Global VK_VOLUME_DOWN            := 0xae         ; Volume Down
Global VK_VOLUME_UP              := 0xaf         ; Volume Up
Global VK_MEDIA_NEXT_TRACK       := 0xb0         ; Next Track
Global VK_MEDIA_PREV_TRACK       := 0xb1         ; Previous Track
Global VK_MEDIA_STOP             := 0xb2         ; Stop Media
Global VK_MEDIA_PLAY_PAUSE       := 0xb3         ; Play/Pause Media
Global VK_LAUNCH_MAIL            := 0xb4         ; Start Mail
Global VK_LAUNCH_MEDIA_SELECT    := 0xb5         ; Select Media
Global VK_LAUNCH_APP1            := 0xb6         ; Start Application 1
Global VK_LAUNCH_APP2            := 0xb7         ; Start Application 2
Global VK_OEM_1                  := 0xba         ; Used for miscellaneous characters; it can vary by keyboard. For the US standard
                                                 ; keyboard, the ';:'
Global VK_OEM_PLUS               := 0xbb         ; For any country/region, the '+'
Global VK_OEM_COMMA              := 0xbc         ; For any country/region, the ','
Global VK_OEM_MINUS              := 0xbd         ; For any country/region, the '-'
Global VK_OEM_PERIOD             := 0xbe         ; For any country/region, the '.'
Global VK_OEM_2                  := 0xbf         ; Used for miscellaneous characters; it can vary by keyboard. For the US standard
                                                 ; keyboard, the '/?'
Global VK_OEM_3                  := 0xc0         ; Used for miscellaneous characters; it can vary by keyboard. For the US standard
                                                 ; keyboard, the '`~'
Global VK_OEM_4                  := 0xdb         ; Used for miscellaneous characters; it can vary by keyboard. For the US standard
                                                 ; keyboard, the '[{'
Global VK_OEM_5                  := 0xdc         ; Used for miscellaneous characters; it can vary by keyboard. For the US standard
                                                 ; keyboard, the '\|'
Global VK_OEM_6                  := 0xdd         ; Used for miscellaneous characters; it can vary by keyboard. For the US standard
                                                 ; keyboard, the ']}'
Global VK_OEM_7                  := 0xde         ; Used for miscellaneous characters; it can vary by keyboard. For the US standard
                                                 ; keyboard, the 'single-quote/double-quote'
Global VK_OEM_8                  := 0xdf         ; Used for miscellaneous characters; it can vary by keyboard
Global VK_OEM_102                := 0xe2         ; The <> keys on the US standard keyboard, or the \\| key on the non-US 102-key
												 ; keyboard
Global VK_PROCESSKEY             := 0xe5         ; IME PROCESS
Global VK_ATTN                   := 0xf6         ; Attn
Global VK_CRSEL                  := 0xf7         ; CrSel
Global VK_EXSEL                  := 0xf8         ; ExSel
Global VK_EREOF                  := 0xf9         ; Erase EOF
Global VK_PLAY                   := 0xfa         ; Play
Global VK_ZOOM                   := 0xfb         ; Zoom
Global VK_PA1                    := 0xfd         ; PA1
Global VK_OEM_CLEAR              := 0xfe         ; Clear

; DEFINIZIONE CARATTERI ASCII DI CONTROLLO =========================================================================================

Global NUL                             := Chr( 0 )                   ; Carattere NULl
Global SOH                             := Chr( 1 )                   ; Carattere Start Of Heading
Global STX                             := Chr( 2 )                   ; Carattere Start of TeXt
Global ETX                             := Chr( 3 )                   ; Carattere End of TeXt
Global EOT                             := Chr( 4 )                   ; Carattere End Of Transmission
Global ENQ                             := Chr( 5 )                   ; ENQiry
Global ACK                             := Chr( 6 )                   ; ACKnowledge
Global BEL                             := Chr( 7 )                   ; BELl - Corrisponde a `a
Global BS                              := Chr( 8 )                   ; BackSpace - Corrisponde a `b
Global HT                              := Chr( 9 )                   ; Carattere Horizontal Tab - Corrisponde a `t
Global TAB                             := Chr( 9 )                   ; Carattere horizontal TAB - Corrisponde a `t
Global LF                              := Chr( 10 )                  ; Carattere Line Feed - Corrisponde a `n
Global VT                              := Chr( 11 )                  ; Carattere Vertical Tab - Corrisponde a `v
Global FF                              := Chr( 12 )                  ; Carattere Form Feed - Corrisponde a `f
Global CR                              := Chr( 13 )                  ; Carattere Carriage Return - Corrisponde a `r
Global SO                              := Chr( 14 )                  ; Carattere Shift Out
Global SI                              := Chr( 15 )                  ; Carattere Shift In
Global DLE                             := Chr( 16 )                  ; Carattere Data Link Escape
Global DC1                             := Chr( 17 )                  ; Carattere Device Control 1 ( XON )
Global DC2                             := Chr( 18 )                  ; Carattere Device Control 2
Global DC3                             := Chr( 19 )                  ; Carattere Device Control 3 ( XOFF )
Global DC4                             := Chr( 20 )                  ; Carattere Device Control 4
Global NAK                             := Chr( 21 )                  ; Carattere Negative AcKnowledge
Global SYN                             := Chr( 22 )                  ; Carattere SYNchronous idle
Global ETB                             := Chr( 23 )                  ; Carattere End of Transmission Block
Global CAN                             := Chr( 24 )                  ; Carattere CANcel
Global EM                              := Chr( 25 )                  ; Carattere End of Medium
Global SUB                             := Chr( 26 )                  ; Carattere SUBstitute
Global ESC                             := Chr( 27 )                  ; Carattere ESCape
Global FS                              := Chr( 28 )                  ; Carattere File Separator
Global GS                              := Chr( 29 )                  ; Carattere Group Separator
Global RS                              := Chr( 30 )                  ; Carattere Record Separator
Global US                              := Chr( 31 )                  ; Carattere Unit Separator
Global DEL                             := Chr( 127 )                 ; Carattere DELete

; DEFINIZIONE LANGUAGE CODES =======================================================================================================
; La variabile di linguaggio A_Language specifica il codice numerico della lingua attualmente attiva ( language code ), che NON È il
; layout di tastiera.
; Esempio:
; The_language := LANGUAGECODE_%A_Language%  ; Get the name of the system's default language.
; MsgBox %the_language%  ; Display the language name.

Global LANGUAGECODE_0436               := "Afrikaans"
Global LANGUAGECODE_041c               := "Albanian"
Global LANGUAGECODE_0401               := "Arabic Saudi Arabia"
Global LANGUAGECODE_0801               := "Arabic Iraq"
Global LANGUAGECODE_0c01               := "Arabic Egypt"
Global LANGUAGECODE_1001               := "Arabic Libya"
Global LANGUAGECODE_1401               := "Arabic Algeria"
Global LANGUAGECODE_1801               := "Arabic Morocco"
Global LANGUAGECODE_1c01               := "Arabic Tunisia"
Global LANGUAGECODE_2001               := "Arabic Oman"
Global LANGUAGECODE_2401               := "Arabic Yemen"
Global LANGUAGECODE_2801               := "Arabic Syria"
Global LANGUAGECODE_2c01               := "Arabic Jordan"
Global LANGUAGECODE_3001               := "Arabic Lebanon"
Global LANGUAGECODE_3401               := "Arabic Kuwait"
Global LANGUAGECODE_3801               := "Arabic UAE"
Global LANGUAGECODE_3c01               := "Arabic Bahrain"
Global LANGUAGECODE_4001               := "Arabic Qatar"
Global LANGUAGECODE_042b               := "Armenian"
Global LANGUAGECODE_042c               := "Azeri Latin"
Global LANGUAGECODE_082c               := "Azeri Cyrillic"
Global LANGUAGECODE_042d               := "Basque"
Global LANGUAGECODE_0423               := "Belarusian"
Global LANGUAGECODE_0402               := "Bulgarian"
Global LANGUAGECODE_0403               := "Catalan"
Global LANGUAGECODE_0404               := "Chinese Taiwan"
Global LANGUAGECODE_0804               := "Chinese PRC"
Global LANGUAGECODE_0c04               := "Chinese Hong Kong"
Global LANGUAGECODE_1004               := "Chinese Singapore"
Global LANGUAGECODE_1404               := "Chinese Macau"
Global LANGUAGECODE_041a               := "Croatian"
Global LANGUAGECODE_0405               := "Czech"
Global LANGUAGECODE_0406               := "Danish"
Global LANGUAGECODE_0413               := "Dutch Standard"
Global LANGUAGECODE_0813               := "Dutch Belgian"
Global LANGUAGECODE_0409               := "English United States"
Global LANGUAGECODE_f001               := "English United States International"
Global LANGUAGECODE_0809               := "English United Kingdom"
Global LANGUAGECODE_0c09               := "English Australian"
Global LANGUAGECODE_1009               := "English Canadian"
Global LANGUAGECODE_1409               := "English New Zealand"
Global LANGUAGECODE_1809               := "English Irish"
Global LANGUAGECODE_1c09               := "English South Africa"
Global LANGUAGECODE_2009               := "English Jamaica"
Global LANGUAGECODE_2409               := "English Caribbean"
Global LANGUAGECODE_2809               := "English Belize"
Global LANGUAGECODE_2c09               := "English Trinidad"
Global LANGUAGECODE_3009               := "English Zimbabwe"
Global LANGUAGECODE_3409               := "English Philippines"
Global LANGUAGECODE_0425               := "Estonian"
Global LANGUAGECODE_0438               := "Faeroese"
Global LANGUAGECODE_0429               := "Farsi"
Global LANGUAGECODE_040b               := "Finnish"
Global LANGUAGECODE_040c               := "French Standard"
Global LANGUAGECODE_080c               := "French Belgian"
Global LANGUAGECODE_0c0c               := "French Canadian"
Global LANGUAGECODE_100c               := "French Swiss"
Global LANGUAGECODE_140c               := "French Luxembourg"
Global LANGUAGECODE_180c               := "French Monaco"
Global LANGUAGECODE_0437               := "Georgian"
Global LANGUAGECODE_0407               := "German Standard"
Global LANGUAGECODE_0807               := "German Swiss"
Global LANGUAGECODE_0c07               := "German Austrian"
Global LANGUAGECODE_1007               := "German Luxembourg"
Global LANGUAGECODE_1407               := "German Liechtenstein"
Global LANGUAGECODE_0408               := "Greek"
Global LANGUAGECODE_040d               := "Hebrew"
Global LANGUAGECODE_0439               := "Hindi"
Global LANGUAGECODE_040e               := "Hungarian"
Global LANGUAGECODE_040f               := "Icelandic"
Global LANGUAGECODE_0421               := "Indonesian"
Global LANGUAGECODE_0410               := "Italian Standard"
Global LANGUAGECODE_0810               := "Italian Swiss"
Global LANGUAGECODE_0411               := "Japanese"
Global LANGUAGECODE_043f               := "Kazakh"
Global LANGUAGECODE_0457               := "Konkani"
Global LANGUAGECODE_0412               := "Korean"
Global LANGUAGECODE_0426               := "Latvian"
Global LANGUAGECODE_0427               := "Lithuanian"
Global LANGUAGECODE_042f               := "Macedonian"
Global LANGUAGECODE_043e               := "Malay Malaysia"
Global LANGUAGECODE_083e               := "Malay Brunei Darussalam"
Global LANGUAGECODE_044e               := "Marathi"
Global LANGUAGECODE_0414               := "Norwegian Bokmal"
Global LANGUAGECODE_0814               := "Norwegian Nynorsk"
Global LANGUAGECODE_0415               := "Polish"
Global LANGUAGECODE_0416               := "Portuguese Brazilian"
Global LANGUAGECODE_0816               := "Portuguese Standard"
Global LANGUAGECODE_0418               := "Romanian"
Global LANGUAGECODE_0419               := "Russian"
Global LANGUAGECODE_044f               := "Sanskrit"
Global LANGUAGECODE_081a               := "Serbian Latin"
Global LANGUAGECODE_0c1a               := "Serbian Cyrillic"
Global LANGUAGECODE_041b               := "Slovak"
Global LANGUAGECODE_0424               := "Slovenian"
Global LANGUAGECODE_040a               := "Spanish Traditional Sort"
Global LANGUAGECODE_080a               := "Spanish Mexican"
Global LANGUAGECODE_0c0a               := "Spanish Modern Sort"
Global LANGUAGECODE_100a               := "Spanish Guatemala"
Global LANGUAGECODE_140a               := "Spanish Costa Rica"
Global LANGUAGECODE_180a               := "Spanish Panama"
Global LANGUAGECODE_1c0a               := "Spanish Dominican Republic"
Global LANGUAGECODE_200a               := "Spanish Venezuela"
Global LANGUAGECODE_240a               := "Spanish Colombia"
Global LANGUAGECODE_280a               := "Spanish Peru"
Global LANGUAGECODE_2c0a               := "Spanish Argentina"
Global LANGUAGECODE_300a               := "Spanish Ecuador"
Global LANGUAGECODE_340a               := "Spanish Chile"
Global LANGUAGECODE_380a               := "Spanish Uruguay"
Global LANGUAGECODE_3c0a               := "Spanish Paraguay"
Global LANGUAGECODE_400a               := "Spanish Bolivia"
Global LANGUAGECODE_440a               := "Spanish El Salvador"
Global LANGUAGECODE_480a               := "Spanish Honduras"
Global LANGUAGECODE_4c0a               := "Spanish Nicaragua"
Global LANGUAGECODE_500a               := "Spanish Puerto Rico"
Global LANGUAGECODE_0441               := "Swahili"
Global LANGUAGECODE_041d               := "Swedish"
Global LANGUAGECODE_081d               := "Swedish Finland"
Global LANGUAGECODE_0449               := "Tamil"
Global LANGUAGECODE_0444               := "Tatar"
Global LANGUAGECODE_041e               := "Thai"
Global LANGUAGECODE_041f               := "Turkish"
Global LANGUAGECODE_0422               := "Ukrainian"
Global LANGUAGECODE_0420               := "Urdu"
Global LANGUAGECODE_0443               := "Uzbek Latin"
Global LANGUAGECODE_0843               := "Uzbek Cyrillic"
Global LANGUAGECODE_042a               := "Vietnamese"

I hope these constants are what you search.

zelvap
Posts: 4
Joined: 25 Nov 2021, 19:52

Re: Keyboard Key manage

Post by zelvap » 23 May 2023, 09:57

Thank you very much!

Grazie mille!

Post Reply

Return to “AutoHotkey Development”