[Qt-interest] Cross Platform Shortcut Conventions
Andrew Hodgkinson
ahodgkinson at endurancetech.co.uk
Fri Jun 25 19:13:30 CEST 2010
On 25/06/2010 14:53, Josh wrote:
> Thanks ;). I've read this, and it indeed helps, but doesn't really answer
> my question [...]
It seems to me that the only way to be *truly* portable is to restrict
yourself to the named shortcuts supported by QKeySequence. If you wanted
to have other shortcuts, I suspect the only robust approach would be to
supply some kind of editor dialogue box and maybe offer OS-specific
default sets if you're feeling ambitious.
Mac OS X in particular has a large range of shortcuts, particularly using
the function keys with various modifier combinations. You probably have
to count those out. It may well be reasonably 'safe' to use a Ctrl+<foo>
shortcut (Command+<foo> on OS X) for alphabetic keys - not numeric, OS X
uses those globally too, for rapid access to windows or spaces - and use
the QKeySequence table of shortcuts to deduce alphabetic values of <foo>
which are unused across the operating systems listed, at least in their
default configurations.
It would be next to impossible to provide a concrete list of "all used
key shortcuts" or "all safe key shortcuts". The global allocations on Mac
OS X (and probably many other OSs) are very easily edited via the
standard system preferences GUI so many users are likely to have made
individual tweaks. Internationalisation issues change the available
shortcuts and the list of shortcuts it makes sense to use; the
QKeySequence documentation touches upon this. Linux varies with desktop
environment and probably between versions of the same environment too.
As I say, I reckon you need to stick to just the named supported
shortcuts and make anything else editable. Extra shortcuts would need to
be disabled by default, or disabled by default unless the OS and desktop
environment type and version precisely matches that required for one or
more default shortcut sets you construct and ship with your application.
--
Andrew Hodgkinson, Endurance Technology
Land line: 01223 369 408, mobile: 07855 866 780
Registered Office: 5 Marine Drive West, Bognor Regis, W. Sussex, PO21 2QA
More information about the Qt-interest-old
mailing list