Discarding Keyboard-Events for GUI
-
Hi! I have an application that has a keyboard-listener (system-hook). It is being notified on any keyboad-event, even if the app-windows is not active. As far as that it works as designed. My problem is, that it is possible, that someone pushed the space-bar or the cursor-buttons, what effects on the GUI, e.g. to buttons, list-views, etc... So if someone presses the curser-buttons a highlight wanders around my gui. And if the spacebar is hit and a button was highlighted this button will be pressed. This is what i´d like to avoid. What i´d like to have is to make the gui ignore these keyboard inputs (except textboxes, where you need the keyboard). Is there a way of making the GUI-elements not react on keyboard-actions? Thanx J.
-
Hi! I have an application that has a keyboard-listener (system-hook). It is being notified on any keyboad-event, even if the app-windows is not active. As far as that it works as designed. My problem is, that it is possible, that someone pushed the space-bar or the cursor-buttons, what effects on the GUI, e.g. to buttons, list-views, etc... So if someone presses the curser-buttons a highlight wanders around my gui. And if the spacebar is hit and a button was highlighted this button will be pressed. This is what i´d like to avoid. What i´d like to have is to make the gui ignore these keyboard inputs (except textboxes, where you need the keyboard). Is there a way of making the GUI-elements not react on keyboard-actions? Thanx J.
-
This didn´t work the way i need it. For testing i just built a small App, containing a form with 9 buttons. I handled the KeyDown-Event and set SupressKeyPress to true, but i still could navigation through my buttons with the cursor-keys and click them using the space-bar. I checked that with handling the Click-event, which behaved exactly like it did without SupressKeyPress set to true. I guess that this keyboard events are handled BEFOR they even arrive at my KeyDown-handler. The question is, if this prior handling can be suppressed in any way...
-
This didn´t work the way i need it. For testing i just built a small App, containing a form with 9 buttons. I handled the KeyDown-Event and set SupressKeyPress to true, but i still could navigation through my buttons with the cursor-keys and click them using the space-bar. I checked that with handling the Click-event, which behaved exactly like it did without SupressKeyPress set to true. I guess that this keyboard events are handled BEFOR they even arrive at my KeyDown-handler. The question is, if this prior handling can be suppressed in any way...
I tried the same and found one strange thing. Here it is: I have three buttons and a textbox. On buttons click, button name will be displayed in the textbox. If I put breakpoint at keydown event, click event is not fired. But remove the breakpoint and its fired.:confused: I guess you will need to override WndProc method to achieve your task.
-
I tried the same and found one strange thing. Here it is: I have three buttons and a textbox. On buttons click, button name will be displayed in the textbox. If I put breakpoint at keydown event, click event is not fired. But remove the breakpoint and its fired.:confused: I guess you will need to override WndProc method to achieve your task.