KeyPreview fails with button shortcuts

  • Thread starter Thread starter Felix
  • Start date Start date
F

Felix

The Setup:
================
I have a cardswiper attached to my keyboard, so that when I swipe a
card I get "keyboard input" that looks something like:
%748a45a1246fbac9d8fdeaf3572f221b?

I would like forms in my application to handle these card swipes. To
this end, I've made a base Form that sets KeypPeview=true, and that
overrides the ProcessDialogKey method.

The Bug:
==========
This setup works well, except in a few circumestances. One common
circumstance is if I have buttons with shortcuts (e.g. a button whose
Text attribute is "&add member". Here "a" is a shortcut.

I have noticed that if any button on the form has the focus, then "a"
is consumed by the button and does not make it to ProcessDialogKey. If
something else (like a listbox) has the focus, then I do receive the
key in ProcessDialogKey.

Does anyone have a solution, an idea, or a workaround?

Thanks in advance!

Felix
 
The Setup:
================
I have a cardswiper attached to my keyboard, so that when I swipe a
card I get "keyboard input" that looks something like:
%748a45a1246fbac9d8fdeaf3572f221b?

I would like forms in my application to handle these card swipes. To
this end, I've made a base Form that sets KeypPeview=true, and that
overrides the ProcessDialogKey method.

The Bug:
==========
This setup works well, except in a few circumestances. One common
circumstance is if I have buttons with shortcuts (e.g. a button whose
Text attribute is "&add member". Here "a" is a shortcut.

I have noticed that if any button on the form has the focus, then "a"
is consumed by the button and does not make it to ProcessDialogKey. If
something else (like a listbox) has the focus, then I do receive the
key in ProcessDialogKey.

Does anyone have a solution, an idea, or a workaround?

Thanks in advance!

Felix
 
Back
Top