Jump to content

_IsPressed showing key press but no keys being pressed, why?


Recommended Posts

5 minutes ago, Bert said:

Two things to try:

Test 1: try increasing the milliseconds on the key press and let us know what happens. 

Test 2: run the script with Windows in safe mode. 

_isPressed does not have a limiter, there are only two options.  The key code and optionally a handle to a DLL.

I did put in a Sleep statement within the loop and played with that timing but that just slowed or sped up the console writes, the keys still displayed in console.

While phantom keys were being tracked I opened task manager and closed non-windows critical processes minus Scite and the running script.  The keys still displayed in console.

You pressed the: 00000029 { 41 } Key!
You pressed the: 0000002A { 42 } Key!
You pressed the: 0000002C { 44 } Key!
You pressed the: 0000002E { 46 } Key!
You pressed the: 00000030 { 48 } Key!
You pressed the: 00000031 { 49 } Key!
You pressed the: 00000034 { 52 } Key!
You pressed the: 00000029 { 41 } Key!
You pressed the: 0000002A { 42 } Key!
You pressed the: 0000002C { 44 } Key!
You pressed the: 0000002E { 46 } Key!
You pressed the: 00000030 { 48 } Key!
You pressed the: 00000031 { 49 } Key!
You pressed the: 00000034 { 52 } Key!
You pressed the: 00000029 { 41 } Key!
You pressed the: 0000002A { 42 } Key!
You pressed the: 0000002C { 44 } Key!
You pressed the: 0000002E { 46 } Key!
You pressed the: 00000030 { 48 } Key!
You pressed the: 00000031 { 49 } Key!
You pressed the: 00000034 { 52 } Key!
 

Link to comment
Share on other sites

Next step is to make a fresh install of the OS, with a complete format of the system disk (and format of secondary disk).  Install the minimum software possible along with AutoIt. Then test your script again.  If you still have the problem, it would tend to prove that you have a hardware problem. If you don't have the problem anymore, then install one software at a time, and test your script after each install...

Link to comment
Share on other sites

7 minutes ago, Nine said:

Next step is to make a fresh install of the OS, with a complete format of the system disk (and format of secondary disk).  Install the minimum software possible along with AutoIt. Then test your script again.  If you still have the problem, it would tend to prove that you have a hardware problem. If you don't have the problem anymore, then install one software at a time, and test your script after each install...

 

That is not an option.

Link to comment
Share on other sites

11 hours ago, iAmNewbe said:

 

That is not an option.

do you have the ability to install a virtual machine program? that would create the same environment as a fresh install.

If @error Then
    MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!")
EndIf

"Yeah yeah yeah patience, how long will that take?"  -Ed Gruberman

REAL search results  |  SciTE4AutoIt3 Editor Full Version

Link to comment
Share on other sites

An other function is present on the forum, do you have the same result with it :

 

#include <Misc.au3>

While 1
    For $i = 0 to 255
        If (_IsPressedDLL(Hex($i))) Then
           ConsoleWrite("You pressed the: " & Hex($i) & " { " & $i & " } Key!" & @CRLF)
           Sleep(250)
        EndIf
    next
WEnd



Func _IsPressedDLL($sHexKey, $vDLL = 'user32.dll')
    Local $a_R = DllCall($vDLL, "short", "GetAsyncKeyState", "int", '0x' & $sHexKey)
    If @error Then Return SetError(@error, @extended, False)
    Return BitAND($a_R[0], 0x8000) <> 0
EndFunc

 

Link to comment
Share on other sites

To increase the milliseconds on the key press you can do it via command line.

reg add "HKCU\Control Panel\Keyboard" /v KeyboardDelay /t REG_SZ /d "0" /f

The value "0" is where you set the milliseconds. I believe the values can be set from 0 to 3 with 3 being the slowest. 

Also you can set the milliseconds in the control panel. https://www.softwareok.com/?seite=faq-Windows-10&faq=51

Link to comment
Share on other sites

On 8/1/2019 at 8:23 AM, Bert said:

To increase the milliseconds on the key press you can do it via command line.


reg add "HKCU\Control Panel\Keyboard" /v KeyboardDelay /t REG_SZ /d "0" /f

The value "0" is where you set the milliseconds. I believe the values can be set from 0 to 3 with 3 being the slowest. 

Also you can set the milliseconds in the control panel. https://www.softwareok.com/?seite=faq-Windows-10&faq=51

I use Windows 7 but same utility. Changing these settings does not effect the result.  

This still happens randomly with random keys and amount of them.  Sometimes it is 2 sometimes it is 15 keys randomly cycling and NONE of them pass through to any applications such as text editors.   I have removed and introduced 5 separate keyboards wired and wireless, same issue occurs.  This is not tied to any specific keyboard, just happens with ANY keyboard plugged into system.

Edited by iAmNewbe
Link to comment
Share on other sites

I have stopped all but the basic windows processes in testing and any application that could send or introduce keys like this have been shut down.  Still occurs.
Tried safe mode again and waited and waited and this issue finally appeared...   

What I am doing is periodically running the code that checks for keys pressed from within a keyboard reprogram application I wrote with AutoIT to reprogram programmable keys on various keyboards I have and use. I just check every so often if there are run away keys going and manually press those keyboard keys. Instantly stops them.  Why it keeps happening I have no idea.  There is no virus or malware on the system.

I am pretty much done trying to track this down.  

Thank you everyone for helping and giving suggestions to try.

Link to comment
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
 Share

×
×
  • Create New...