Trying to detect ALT + key in Form ....
Publicado: Vie Feb 05, 2016 12:55 pm
Hi,
Am exploring how to make Buttons or Prompts respond to mouse clicks and key presses including ALT+Key combinations .... maybe enhanced TButtons or maybe TLabel/TLabelEx made into buttons.
I have looked at how TButton uses the & to give it an Action Key and how this adds the Key to an array ::aShortcut in TForm.
I would like to Add ALT+key combinations to be Action keys in the form.
I could have a ::aAltKeys in an inherited TForm and Add and Remove oControls like in ::aShortcut .... this would be quite elegant and 'correct'.
Then I need to detect the ALT+key and scan my ::aAltKeys.
Problem here is I have not found a way to detect the ALT+Keys at form level usinf say FormKeyDown() or FormChar() ..... is there a way I can use?
or I could use XA_SetKey() again adding and deleting ALT+keys as necessary ..... no very elegant and not very 'correct' .... but maybe my best chance?
Another question .... do we have the source to XA_SetKey(), I can't find it and it might be useful to me?
Any thoughts would be appreciated.
Thanks
Chris
Am exploring how to make Buttons or Prompts respond to mouse clicks and key presses including ALT+Key combinations .... maybe enhanced TButtons or maybe TLabel/TLabelEx made into buttons.
I have looked at how TButton uses the & to give it an Action Key and how this adds the Key to an array ::aShortcut in TForm.
I would like to Add ALT+key combinations to be Action keys in the form.
I could have a ::aAltKeys in an inherited TForm and Add and Remove oControls like in ::aShortcut .... this would be quite elegant and 'correct'.
Then I need to detect the ALT+key and scan my ::aAltKeys.
Problem here is I have not found a way to detect the ALT+Keys at form level usinf say FormKeyDown() or FormChar() ..... is there a way I can use?
or I could use XA_SetKey() again adding and deleting ALT+keys as necessary ..... no very elegant and not very 'correct' .... but maybe my best chance?
Another question .... do we have the source to XA_SetKey(), I can't find it and it might be useful to me?
Any thoughts would be appreciated.
Thanks
Chris