Page 1 of 1

Remap shift key without destroy all hotkeys of shift key

Posted: 20 Apr 2017, 11:53
by dsewq1LYJ
What I'm trying to do is fix a problem with my Input Layout.

That's a feature you can swap between two Input Layout by 'Shift' key.
So the problem cause by Shift hotkey

All hotkeys which using 'Shift' as modifier will trigger this feature synchronously.
such as...

Code: Select all

+b::return
+^a::return
+^!r::return
Uh...so it's extreme annoying, the solution what I thought is remap the shift key to detect if there's any hotkey pressed.
if I did pressed any hotkeys then dont press shift when I release.

Yeah it works like a charm but if I remap my shift key, it ruined all hotkeys about "Shift".

code:

Code: Select all

*Shift::
Gosub monitorHotkey
return
Shift Up::
if !IsTriggered
    Send {Shift}
return
+f::Tooltip I'M NOT GONNA WORK.
+^f:;Tooltip ME TOO.
Help me please :( This problem driven me crazy...it's super ...extreme... annoying...

Re: Remap shift key without destroy all hotkeys of shift key

Posted: 20 Apr 2017, 13:35
by DyaTactic
I think the other hotkeys don't work because the shift key is hidden. I added a tilde (~) before the shift hotkey so the key press is no longer hidden. However, the same applies for your application. Is it a solution if you just send an Shift keystroke after you used your hotkey? The Shift keypress toggles the input layout, sending one after using the hotkey toggles it back not?

Code: Select all

~*Shift::
	Gosub monitorHotkey
	return
~Shift Up::
	if !IsTriggered
	    Send {Shift}
	return
	
+f::Tooltip I'M NOT GONNA WORK.
+^f::Tooltip ME TOO.

Re: Remap shift key without destroy all hotkeys of shift key

Posted: 20 Apr 2017, 20:03
by dsewq1LYJ
DyaTactic wrote:I think the other hotkeys don't work because the shift key is hidden. I added a tilde (~) before the shift hotkey so the key press is no longer hidden. However, the same applies for your application. Is it a solution if you just send an Shift keystroke after you used your hotkey? The Shift keypress toggles the input layout, sending one after using the hotkey toggles it back not?

Code: Select all

~*Shift::
	Gosub monitorHotkey
	return
~Shift Up::
	if !IsTriggered
	    Send {Shift}
	return
	
+f::Tooltip I'M NOT GONNA WORK.
+^f::Tooltip ME TOO.
If the shift key is tilded then it would swap my Input Layout after I release my shift key even if I suspend the 'Shift up' hotkey.

Uh ~ it's a nice try, but it still cause the same problem :<

Case.1 Suspend *shift: but shift up::
Triggered.
Case.2 Suspend shift up:: but *shift::
Triggered.
Case.3 Suspend shift up:: and *shift::
Problem with all hotkeys with shift key.

Re: Remap shift key without destroy all hotkeys of shift key

Posted: 21 Apr 2017, 03:36
by DyaTactic
Indeed the layout swaps, is it a solution if Autohotkey swaps it back direcly after the hotkeys is released?

Re: Remap shift key without destroy all hotkeys of shift key

Posted: 27 Apr 2017, 04:03
by dsewq1LYJ
DyaTactic wrote:Indeed the layout swaps, is it a solution if Autohotkey swaps it back direcly after the hotkeys is released?
It's a good idea, but this cause another problem.
If I tap Shift key and swap my IME to another, then if I press Shift+AnyKey then this revert my IME to the en-us, then I need to press Shift key again to swap it back.

I did find out I can remap Shift key and using #If GetKeyState("Shift","P") to solve this problem, but... this huge remap cause performance drop a lot.

I'm clueless now....dont know how to monitor Shift key without interrupt anything.

Re: Remap shift key without destroy all hotkeys of shift key

Posted: 02 May 2017, 02:30
by DyaTactic
Maybe someone else can shine some light on this. I'm not getter further either.