Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
processing keystrokes without missing any
#1
I have a macro that performs an incremental search in a predefined list. It starts like this:


rep
    int vk=wait(5 KF)
    ;;processing of pressed key (adding it to the search string, finding the search string in predefined list, 
    ;;displaying the found items via onscreendisplay, etc.
    

The macro works, but the problem is that when the user types too fast, not all pressed keys are registered by the vk=wait(5 KF) instruction, probably because the processing part takes longer than it takes for a fast typist to type the next keystroke. 

How can I prevent this and make sure all keys pressed by the user are registered?
#2
If it must work in any process (or in a process other than the script), need a low-level keyboard hook. The `wait KF` uses it too. Search in this forum: WH_KEYBOARD_LL. Also you can find examples in https://www.libreautomate.com/forum/show...p?tid=2852
#3
thanks, i got it working


Forum Jump:


Users browsing this thread: 2 Guest(s)