capture function keys

Post

Posted
Rating:
#1 (In Topic #1784)
Avatar
Enthusiast
sadams54 is in the usergroup ‘Enthusiast’

I am having issues with capturing function keys

I have a feature in a program that allows a user to make notes attached to a function key. They press the key and poof the predefined notes are added. The problem is that some of these keys have other features. I capture the key in the _Keypress  event. it works.  however if I for example press the F7 key, I get the notes fine but the cursor disappears entirely until you hit F7 again. This tells me that the keypress is being caught and processed but sent along to the OS also for processing. How do I stop that? how do I capture the key and process like I am but stop the key from any further processing by the OS?
Online now: No Back to the top

Post

Posted
Rating:
#2
Banned
Use 'Stop Event' to stop the keypress being picked up by the toolkit

Code


Public Sub Form_Keypress()

  Select Key.code
  Case Key.F7
    DoYourThing()
    Stop Event
  End Select

End

Online now: No Back to the top
1 guest and 0 members have just viewed this.