[Lazarus] Platform dependent modifier for common shortcut-keys?

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Oct 6 08:29:36 CEST 2011


Bart schrieb:

> Some LCL controls have hardcoded Ctrl+C, Ctlr+Home (etc.) for this,
> but that makes them incompatible with Mac standards.
> 
> Would it be a bad idea to define a constand that equals ssCtrl on
> non-Mac and ssMeta on a Mac?

That's up to the low-level keyboard functions, which translate physical 
keys into ssCtrl etc.  But then ssMeta also could map to the Apple and 
Windows key, depending on the platform.


> This would avoid having to write widgetset implementations for
> DoKeyDown/DoKeyPress of LCL controls that have build-in support for
> these key combinations.

Key combinations are a different topic, more subject to Actions, where 
standard Actions can have their platform specific shortcuts. Then the 
question were, whether the LCL maps the platform-specific shortcuts to a 
predefined constant (VK_CUT, VK_COPY...), or whether comparisons should 
be made against something like CutAction.Shortcut.


> If so, should this be an LCL feature (since it mostly concerns GUI
> widgets), or should it be done in the classes unit?

Regardless of where such mapping is done, how can a user find out which 
shortcuts are *not* already assigned, free for use with his *own* actions?

What about menu-provided shortcuts, when ALT-F-X maps to Exit on an 
English system (File-Exit), while a German user had to use ALT-D-B 
(Datei-Beenden) instead?

DoDi





More information about the Lazarus mailing list