-1

I have to use USB barcode scanner in application running on remote desktop. This scanner is being recognised by Windows as keyboard. When I try to scan barcode however, every 3th or 4th character is being changed to another one. When I type numbers by hand, they are being correctly written. The question is: is there any way to programmatically produce "lag" on keyboard globally? I would like to create for example a half second gap between keyboard input events and a result on the screen. Some time ago I worked with Windows hooks, and I was able to change keyboard input globally, but I remember I had problems with delaying it. Is there any other way?

Siocki
  • 53
  • 2
  • 9
  • 1
    "*Is there any other way?*" - figure out why your characters are being changed and fix that instead. Maybe you have a bad driver. Maybe the remote access is faulty. What you type on one end should be what ends up on the other end, lag or not. Otherwise, maybe redesign your approach. Have a local app capture the scanner input and then transmit it to the remote app using TCP or named pipes. – Remy Lebeau Dec 26 '17 at 19:59
  • More than likely this has more to do with the scanner/computer interface, look for ways to slow it down to an acceptable limit. – Mark Schultheiss Dec 26 '17 at 20:41
  • I'm voting to close this question as off-topic because the OP misanalyzed the problem and is now asking for a solution to a problem that doesn't exist. This isn't helpful to anyone, including the OP. – IInspectable Dec 26 '17 at 23:28

1 Answers1

0

you can make an autohotkey script to listen to a keyboard input, wait and then press the same keyboard button.

once you have intalled AHK(autohotkey) , you can do a AHK script whit the intructions that are in the ahk documentation.

  1. Right-Click on your desktop.
  2. Find "New" in the menu.
  3. Click "AutoHotkey Script" inside the "New" menu.
  4. Give the script a new name. Note: It must end with a .ahk extension. Ex. MyScript.ahk
  5. Find the newly created file on your desktop and Right-Click it.
  6. Click "Edit Script".
  7. A window should have popped up, probably Notepad. If so, SUCCESS!
i::
  sleep, 500 ;
  Send, i
Return

(you can change the "i" for other keyboard keys).

a function would reduce the amount of code that you use, but i don't know how to do it in a AHK script

Xein_
  • 1
  • 1