Problem with laptop keyboard

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ganikkus
Posts: 5
Joined: 14 Jan 2022, 21:06

Problem with laptop keyboard

Post by ganikkus » 14 Jan 2022, 21:28

hey there, I have a very basic script running on my Lenovo laptop with ABNT keyboard layout and Windows 11.

Code: Select all

#NoEnv
#SingleInstance, force 
SendMode Input
SetWorkingDir %A_ScriptDir%
 
LAlt::LCtrl
LCtrl::LAlt
Capslock::RCtrl
If I keep "Alt" key pressed I get the following error message:

Code: Select all

71 hotkeys have been received in last 1718ms.
The same script runs without problem on my desktop using a US keyboard. If I use same external keyboard on my laptop, the script also runs without problems.

This is just a simplified example, my actual script has another problems when I use the laptop keyboard, like hotkeys that dont work as expected.

I'd like to know if there is any config I need to add to make it work properly or if this is something related to Windows 11. I dont't think I had these problems on Windows 10.

Thanks

amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: Problem with laptop keyboard

Post by amateur+ » 14 Jan 2022, 22:52

Unlikely it will help since I suppose your problem is in hardware, but you can try something of these variants:

Code: Select all

sc38::LCtrl	
sc1D::LAlt

Code: Select all

#InputLevel 0
LAlt::LCtrl
LCtrl::LAlt
Actual scan codes may be different in your keyboard, you may use AhkSpy.ahk to determine them.
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.

ganikkus
Posts: 5
Joined: 14 Jan 2022, 21:06

Re: Problem with laptop keyboard

Post by ganikkus » 15 Jan 2022, 09:16

Thanks for the reply. I tried both suggestions but I still get the warning. Not sure if it's a hardware since the I'm pretty sure it worked on windows 10. Here is the output of the tool you suggested. The scan codes you posted are right:
Screenshot_2.png
Screenshot_2.png (295.36 KiB) Viewed 722 times

ganikkus
Posts: 5
Joined: 14 Jan 2022, 21:06

Re: Problem with laptop keyboard

Post by ganikkus » 15 Jan 2022, 17:01

I just confirmed it also happens in Windows 10 =/

amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: Problem with laptop keyboard

Post by amateur+ » 17 Jan 2022, 10:33

Maybe @mikeyww could come with a good advice. I don't have an experience to help you here, sorry.
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.


amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: Problem with laptop keyboard

Post by amateur+ » 17 Jan 2022, 16:23

@ganikkus, btw, make sure you use the last version of AHK (1.1.33.10)
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.

ganikkus
Posts: 5
Joined: 14 Jan 2022, 21:06

Re: Problem with laptop keyboard

Post by ganikkus » 17 Jan 2022, 19:43

Hi, thanks again for the replies
amateur+ wrote: @ganikkus, btw, make sure you use the last version of AHK (1.1.33.10)
Yes, I'm running the latest version 1.1.33.10
@mikeyww Just made a new test with the following script:

Code: Select all

#NoEnv
#SingleInstance, force 
SendMode Input
SetWorkingDir %A_ScriptDir%

LAlt::LCtrl
  • By pressing and holding LAlt in laptop's keyboad (Brazilian Portuguese ABNT layout) for about 4 seconds I get the error: "71 hotkeys have been received in last 1718ms."
  • Connecting a external USB keyboard (US layout) and keeping the LAlt pressed I do not get the error.
  • Connecting a external USB keyboard (Brazilian Portuguese ABNT layout) and keeping the LAlt pressed I do not get the error.
Maybe @amateur+ was right in the first post and it is a hardware issue. Looks like the problem is the laptop's keyboard and not the layout. Does this help narrow the possibilities?

ganikkus
Posts: 5
Joined: 14 Jan 2022, 21:06

Re: Problem with laptop keyboard

Post by ganikkus » 23 Jan 2022, 09:45

Does anyone have similar problemas with laptop keyboard?

User avatar
mikeyww
Posts: 26847
Joined: 09 Sep 2014, 18:38

Re: Problem with laptop keyboard

Post by mikeyww » 23 Jan 2022, 09:58

I see no reason for that error to occur unless perhaps another script is running at the same time, or the keyboard itself is faulty. Would have a look at the KeyHistory in case it is informative. Others may have some additional thoughts here. Using Send instead of a remap might be a functional workaround.

Code: Select all

LAlt::
Send {LCtrl down}
SoundBeep, 1500
Return

<^LAlt Up::
Send {LCtrl up}
SoundBeep, 1000
Return
The default max hotkeys per interval is 70. Although you can increase the number-- and might "fix" the problem-- I'm not sure why it would be necessary.

The documentation remarks may be informative in explaining limitations, hook-related issues, how the remap works, and special issues with Ctrl. You might want to try the expanded translation of the remap, perhaps with some adjustments. It looks like the key delay is also important, as discussed in the documentation.

Post Reply

Return to “Ask for Help (v1)”