PiotrCh 0 Posted 11 hours ago When TStringGrid or TDrawGrid is read only (goEditing off), than I see issues with the keyboard. If there is somewhere e.g. label with Caption="&Word Wrap", than when grid is focused and I press "W", the action Alt+W is triggered without me pressing Alt. This is super easy to replicate, can someone comment what is going on? And how to fix it or mitigate? Reagrds, Piotr Share this post Link to post
PeterBelow 251 Posted 3 hours ago 7 hours ago, PiotrCh said: When TStringGrid or TDrawGrid is read only (goEditing off), than I see issues with the keyboard. If there is somewhere e.g. label with Caption="&Word Wrap", than when grid is focused and I press "W", the action Alt+W is triggered without me pressing Alt. This is super easy to replicate, can someone comment what is going on? And how to fix it or mitigate? Reagrds, Piotr It has worked this way for many Windows versions: if the control with focus is not editable a shortcut will be triggered if the matching character key is pressed even if Alt is not held down. The VCL just adheres to that Microsoft UI design choice. You can add a handler for the parent form's OnShortcut event (or override the virtual IsShortcut method) to change the default behaviour. If you want to learn more about key handling in a VCL app here is a link to an old article of mine on the subject (Delphi 7 vintage). Share this post Link to post