Cancel
Showing results for 
Search instead for 
Did you mean: 

Viewer- KeyDown Event suppressed

Pioneer
Pioneer

Hello,

 

I created my own Viewer. I would like to add handler for KeyDown event- to create services for copy (Ctrl+C) and past (Ctrl+V). But I found that only keys that are not defined in  user customization (Customize Keyboard) trigger KeyDown event.

 

So, for example when I pressed Ctrl+C the event is not trigered cause this key combination is  assigend to "Copy" comamnd.

Is there any way to trigger event KeyDown no matter if it was assigned to command or not?

Is there a way to get all Keyboard shortcut combinations ?

 

Of cours, I can hook all keyboard event out of Process Simulate application, but I would like to avoid it.

 

BR,

Terror_Error

3 REPLIES

Re: Viewer- KeyDown Event suppressed

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Terror_Error,

 

Is that a WindowsForms viewer or WPF?

 

Best Regards,

DianaG

Re: Viewer- KeyDown Event suppressed

Pioneer
Pioneer

Hi,

 

WindowsForms viewer.

I tried handle KeyDown event in every possible way:

 

this.Parent.KeyDown += new KeyEventHandler(KeyDown);

this.txFlex.KeyDown += new KeyEventHandler(KeyDown);

this.KeyDown += new KeyEventHandler(KeyDown);

 

Always with the same result.

 

BR,

Terror_Error

 

Re: Viewer- KeyDown Event suppressed

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Terror_Error,

 

If your control is edit field like TextBox, there should not be a problem with the KeyDown event.

I see you have a flex grid, then you can create your own control that inherits from the flex grid and then you can override the bool PreProcessMessage(ref Message msg)

 

Best Regards,

DianaG