Sign in to follow this  
Followers 0
sahsanu

Remap Right Shift to Left Shift

4 posts in this topic

Hello team,

What I need to do?

Remap Right Shift to Left Shift so pressing Right Shift will act as if Left Shift was pressed.

Why?.

I am using synergy+ to control several computers with the same mouse and keyboard but here is the problem, if there is a Remote Desktop on the controlled computer, right shift doesn't work inside this remote desktop but left shift works as expected, that's the reason I need to remap right shift (it is a known synergy bug).

What I tried?

Actually every example about remap keys found on this forum but none works fine (or more correctly I can't made it to work :mellow:) for shift nor alt keys. I was trying to remap Left Alt to Right Alt because it is easier to check whether the remap is working fine (for example: you can press Left Alt + 2 and check if @ is being writed correctly).

Some wrong examples but as I said I tried a lot of things and now after a few hours I don't know even what I tried :P :

#include <Misc.au3>
#cs
Left Shift:     A0
Right Shift:    A1
Left Alt:       A4
Right Alt:      A5
#ce
$dll = DllOpen("user32.dll")
While 1
    If _IsPressed("A4") Then
    Send("{RALT}")
    EndIf
    Sleep(50)
WEnd
DllClose($dll)

HotKeySet("{LALT}","_ChangeMap")
HotKeySet("{ESC}","_Quit")

While 1
    Sleep(50)
WEnd

Func _ChangeMap()
    Send("{RALT}")
EndFunc

Func _Quit()
Exit
EndFunc

Workaround: I can easily remap Right shift to Left shift modifying/adding registry key "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout\Scancode Map" with REG_BINARY value "0x0000000000000000020000002A00360000000000" but this change requires a reboot and the change will be permanent. Just in case you need more info about how to remap keys this way, take a look to this web page. And if someone wants some GUI to do it there are some excellent programs, sharpkeys (this one has source code available) & KeyTweak are two of them.

Thank you all in advance for you time and support.

sahsanu

Share this post


Link to post
Share on other sites



Hello team,

What I need to do?

Remap Right Shift to Left Shift so pressing Right Shift will act as if Left Shift was pressed.

Why?.

I am using synergy+ to control several computers with the same mouse and keyboard but here is the problem, if there is a Remote Desktop on the controlled computer, right shift doesn't work inside this remote desktop but left shift works as expected, that's the reason I need to remap right shift (it is a known synergy bug).

What I tried?

Actually every example about remap keys found on this forum but none works fine (or more correctly I can't made it to work :)) for shift nor alt keys. I was trying to remap Left Alt to Right Alt because it is easier to check whether the remap is working fine (for example: you can press Left Alt + 2 and check if @ is being writed correctly).

Some wrong examples but as I said I tried a lot of things and now after a few hours I don't know even what I tried ;) :

#include <Misc.au3>
#cs
Left Shift:     A0
Right Shift:    A1
Left Alt:       A4
Right Alt:      A5
#ce
$dll = DllOpen("user32.dll")
While 1
    If _IsPressed("A4") Then
    Send("{RALT}")
    EndIf
    Sleep(50)
WEnd
DllClose($dll)

HotKeySet("{LALT}","_ChangeMap")
HotKeySet("{ESC}","_Quit")

While 1
    Sleep(50)
WEnd

Func _ChangeMap()
    Send("{RALT}")
EndFunc

Func _Quit()
Exit
EndFunc

Workaround: I can easily remap Right shift to Left shift modifying/adding registry key "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout\Scancode Map" with REG_BINARY value "0x0000000000000000020000002A00360000000000" but this change requires a reboot and the change will be permanent. Just in case you need more info about how to remap keys this way, take a look to this web page. And if someone wants some GUI to do it there are some excellent programs, sharpkeys (this one has source code available) & KeyTweak are two of them.

Thank you all in advance for you time and support.

sahsanu

Here there is my code for AutoHotKey:

RShift::

SendInput {LShift DownTemp}

Loop

{

Sleep, 10

GetKeyState, state, RShift, P

If state = U

Break

}

SendInput {LShift Up}

Return

I know it's late but can be useful.

Share this post


Link to post
Share on other sites

I know it's late but can be useful.

"27 May 2010" ... only just over a year late. And AutoHotKey code? Your sure you did not mixed up forums. As this is the AutoIt forum.

:)


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

"27 May 2010" ... only just over a year late. And AutoHotKey code? Your sure you did not mixed up forums. As this is the AutoIt forum.

:)

One year I know .. but the guy seemed desperate, and Autoit AutoHotkey are similar. ASD

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0