SC Code Error for Right Shift - v1.37.02

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
skolomir
Posts: 1
Joined: 13 May 2024, 12:04

SC Code Error for Right Shift - v1.37.02

13 May 2024, 12:44

Example 1:

Code: Select all

~1joy1::
Send {sc036 down}
keywait, 1joy1
Send {sc036 up}
return
Explanation:
After sending command "send {sc036 down}", command "send {sc036 up}" is executed even 1joy1 key is still pressed.



Example 2:

Code: Select all

~1joy4::
SendInput {sc036 down}
keywait, 1joy4
SendInput {sc036 up} 
return


Explanation:
After sending command "sendinput {sc036 up}", this command like is replaced with sendinput down. So, instead of sending "SendInput {sc036 up} " at the end of code, we hava again sending "SendInput {sc036 down} ". Even 1joy4 key is released, rshift is still pressed.

Commands for lshift with sc code work normal, I have problem with right shift and sc code.
lexikos
Posts: 9665
Joined: 30 Sep 2013, 04:07
Contact:

Re: SC Code Error for Right Shift - v1.37.02

14 May 2024, 06:28

This is by design, so I have moved the topic out of Bug Reports.

Also note that no one is maintaining v1.1. See End of Life: v1.1.


RShift is released immediately, but it is not by send {sc036 up}. You can confirm that KeyWait is not returning early by checking ListLines or KeyHistory, or by adding ToolTip or similar before and after KeyWait.

Send is designed to restore the modifiers to the state they were in when it began, unless it was explicitly used to change the modifier state.

Send is designed to release modifiers automatically if you do not specify that they should be held down, so SendInput {key up} will generally release RShift before sending, and press it back down afterward. It does so for {sc036 up}.

Send does not recognize that {sc036 down} or {sc036 up} will change the state of RShift, because sc036 is not the correct scancode for RShift. RShift should always have the extended key flag set (i.e. sc136).

Why are you using the scancode at all?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], mikeyww and 124 guests