Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Troubles with non-english layout. #10

Open
jumper047 opened this issue Jun 17, 2019 · 4 comments
Open

Troubles with non-english layout. #10

jumper047 opened this issue Jun 17, 2019 · 4 comments

Comments

@jumper047
Copy link

First, thank you for your code - i cant live without dual role keys,
and your script is only working solution on windows.
Is use dual as BigCtrl replacememnt - with config smth like that.

*Space::
*Space UP::dual.combine("RCtrl", A_ThisHotkey)

Everything works
fine except second layout. In russian layout keys with dots, braces,
etc produces them not regarding what layout is currently selected. So,
i found workaround for that - add for every wrong working key.

*,::
StringReplace, KeytoSend, A_ThisHotkey, *
dual.combo(",")
if (current_is_ru() && !GetKeyState("RCtrl") && !GetKeyState("RAlt") && !GetKeyState("LAlt")) {
	if (GetKeyState("Shift")) {
	dual.SendInput("{Shift Down}{vkBC}{Shift Up}")
} Else {
	dual.SendInput("{vkBC}")
}
} Else {
		SendInput {Blind}{%KeyToSend%}
}
Return

; Some helper functions
; RU - 0x4190419
; EN - 0x4090409
current_layout()
{
  SetFormat, Integer, H
  WinGet, WinID,, A
  ThreadID:=DllCall("GetWindowThreadProcessId", "UInt", WinID, "UInt", 0)
  InputLocaleID:=DllCall("GetKeyboardLayout", "UInt", ThreadID, "UInt")
  Return InputLocaleID
;  if (InputLocaleID == "0x4190419") Return True  
}

current_is_ru()
{
	CurrLoc := current_layout()
	if(CurrLoc = "0x4190419") {
		return True
	}
}

I uploaded entire config here - https://gist.github.com/jumper047/ae15b5e484bfe207d14387b6ff82c5f1

@sergeiantipin
Copy link

@jumper047 , здравствуйте!
Пытаюсь запустить скрипт в логике

*Space::
*Space UP::dual.combine("RShift", A_ThisHotkey)

Запускается, но очень долго приходится зажимать пробел для срабатывания шифта (порядка 2-3 сек), экспериментировал с
settings := {delay: 70, timeout: 300, doublePress: 200}
что не дало результатов.
При запуске ahk ругается на сроки. Методом тыка запуск удается только с изменением кода

#Include <dual>
dual := new Dual
#Include <dual>

а не как у автора

#Include <dual/dual>
dual := new Dual
#Include <dual/defaults>

Дополнительно. Скаченные файлы посетил и рабочий скрипт поместил в :
c:***n\Documents\AutoHotkey\Lib
Программа установлена в програмфайлс.

Если вы используете, как BigCtrl, то не могли бы подсказать, в какой директории разместить и как изменить файлы автора (быть может направите ваши)?

Спасибо.

@jumper047
Copy link
Author

jumper047 commented Apr 18, 2022

@sergeiantipin здравствуйте, если честно - уже не помню, я перешел на https://github.com/ililim/dual-key-remap. У него нет проблем с кириллицей.

tr: I switched to https://github.com/ililim/dual-key-remap, it works well with cyrillic layout.

@jumper047
Copy link
Author

BTW @lydell maybe it is worth to mention that app, https://github.com/ililim/dual-key-remap, in readme as alternative?

lydell added a commit that referenced this issue Apr 19, 2022
@lydell
Copy link
Owner

lydell commented Apr 19, 2022

@jumper047 👍 Added to the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants