Что нового

Создание элементов HotKey Input для GUI

Ksaan

Знающий
Сообщения
207
Репутация
15
Возможно ли запись клавиш не только на Английском но и на русском в зависимости от раскладки?
 
Автор
Yashied

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5,379
Репутация
2,724
Ksaan сказал(а):
Возможно ли запись клавиш не только на Английском но и на русском в зависимости от раскладки?

Да, см. функцию _KeyLoadName().
 

ABSOLUTE

AutoIT User
Сообщения
4
Репутация
0
Быть может кому-то будет полезно. Полный код использования 'HotKeySet':

Код:
$hkey = _GUICtrlHKI_GetHotKey($HotKey)
$hkeyp = _KeyToStr($hkey, "_")

  $hkeyp = StringLower($hkeyp)
  $hKeyp = StringRegExpReplace($hKeyp,"_","\1")

	$hKeyp = StringRegExpReplace($hKeyp,"alt","\!")
	$hKeyp = StringRegExpReplace($hKeyp,"shift","\+")
	$hKeyp = StringRegExpReplace($hKeyp,"ctrl","\^")
	$hKeyp = StringRegExpReplace($hKeyp,"win","\#")

	$hKeyp = StringRegExpReplace($hKeyp,"del","{Del}")
	$hKeyp = StringRegExpReplace($hKeyp,"spacebar","{Space}")
	$hKeyp = StringRegExpReplace($hKeyp,"enter","{Enter}")

	$hKeyp = StringRegExpReplace($hKeyp,"up","{Up}")
	$hKeyp = StringRegExpReplace($hKeyp,"down","{Down}")
	$hKeyp = StringRegExpReplace($hKeyp,"left","{Left}")
	$hKeyp = StringRegExpReplace($hKeyp,"right","{Right}")

	$hKeyp = StringRegExpReplace($hKeyp,"home","{Home}")
	$hKeyp = StringRegExpReplace($hKeyp,"end","{End}")
	$hKeyp = StringRegExpReplace($hKeyp,"esc","{Esc}")
	$hKeyp = StringRegExpReplace($hKeyp,"ins","{Ins}")
	$hKeyp = StringRegExpReplace($hKeyp,"pgup","{PgUp}")

	$hKeyp = StringRegExpReplace($hKeyp,"f1","{F1}")
	$hKeyp = StringRegExpReplace($hKeyp,"f2","{F2}")
	$hKeyp = StringRegExpReplace($hKeyp,"f3","{F3}")
	$hKeyp = StringRegExpReplace($hKeyp,"f4","{F4}")
	$hKeyp = StringRegExpReplace($hKeyp,"f5","{F5}")
	$hKeyp = StringRegExpReplace($hKeyp,"f6","{F6}")
	$hKeyp = StringRegExpReplace($hKeyp,"f7","{F7}")
	$hKeyp = StringRegExpReplace($hKeyp,"f8","{F8}")
	$hKeyp = StringRegExpReplace($hKeyp,"f9","{F9}")
	$hKeyp = StringRegExpReplace($hKeyp,"f10","{F10}")
	$hKeyp = StringRegExpReplace($hKeyp,"f11","{F11}")
	$hKeyp = StringRegExpReplace($hKeyp,"f12","{F12}")
	$hKeyp = StringRegExpReplace($hKeyp,"tab","{Tab}")

	$hKeyp = StringRegExpReplace($hKeyp,"prtscr","{PRINTSCREEN}")
	$hKeyp = StringRegExpReplace($hKeyp,"pause","{PAUSE}")

	$hKeyp = StringRegExpReplace($hKeyp,"num 0","{Numpad0}")
	$hKeyp = StringRegExpReplace($hKeyp,"num 1","{Numpad1}")
	$hKeyp = StringRegExpReplace($hKeyp,"num 2","{Numpad2}")
	$hKeyp = StringRegExpReplace($hKeyp,"num 3","{Numpad3}")
	$hKeyp = StringRegExpReplace($hKeyp,"num 4","{Numpad4}")
	$hKeyp = StringRegExpReplace($hKeyp,"num 5","{Numpad5}")
	$hKeyp = StringRegExpReplace($hKeyp,"num 6","{Numpad6}")
	$hKeyp = StringRegExpReplace($hKeyp,"num 7","{Numpad7}")
	$hKeyp = StringRegExpReplace($hKeyp,"num 8","{Numpad8}")
	$hKeyp = StringRegExpReplace($hKeyp,"num 9","{Numpad9}")

	$hKeyp = StringRegExpReplace($hKeyp,"num \*","{NumpadMult}")
	$hKeyp = StringRegExpReplace($hKeyp,"num \+","{NumpadAdd}")
	$hKeyp = StringRegExpReplace($hKeyp,"num -","{NumpadSub}")
	$hKeyp = StringRegExpReplace($hKeyp,"num /","{NumpadDiv}")
	$hKeyp = StringRegExpReplace($hKeyp,"num \.","{NumpadDot}")

	$hKeyp = StringRegExpReplace($hKeyp,"0x5d","{APPSKEY}")

HotKeySet($hKeyp,"hotkey")
 
Верх