Stack And tile shortcuts/improvements

This is a reply to https://www.freelists.org/post/haiku-development/Stack-And-tile-shortcutsimprovements since I do not use the mailing lists.

Background

nephele suggests some shortcuts for Stack & Tile, mainly using the super (“Windows”) key.

Zenja and Adrien commented that it might be a bad idea because some of the shortcuts may already be in use in 3rd party applications.

My comment

One thing that I have thought about is that shortcut keys should be standardized and reserved. I would reserve the super (“Windows”) key to the operating system. So any key combination using the super key is reserved to be used by the operating system.

All other key combinations can be used by applications.

This also means that the operating system cannot use key combinations without the super key, since that could interfere with application shortcuts.

As an example, nephele’s suggestion of the use of super+F for full screen (of the current active window or Stack & Tile arrangement) is appropriate, since it is an app_server function.

Zenja comment about his application is that he already has implemented it for the same function. But he also recognizes that system- and application meta keys usage may have to be discussed.

TLDR: Reserve the super key for system wide use. System wide shortcuts must use the super key to eliminate interference with application shortcuts. Applications can use any shortcut key combination not using the super key.

Edit: Since keyboards without a super key is an exception rather than the rule, I would not be concerned about those. Users that have a keyboard without a super key should be able to map an alternative key combination to act as a super key. One solution could be to map and reserve an alternative combination that acts as a super key.

3 Likes

One issue here is that system shortcuts already exist that don’t use the super key, and people are very used to them, and in some cases they are also very quick shortcuts, e.g. ctrl+alt+left/right mouse to move/resize windows. I guess these could be changed to e.g. opt+alt. But there are a lot of shortcuts and most do not use opt. For reference: Shortcuts and key combinations

Shortcuts for stack and tile would be great though, I agree.

1 Like

Now is the time to change the shortcuts, before Haiku is released. It will be very difficult to change it afterwards.

There might be applications, such as Zenja noted, that already uses the suggested shortcuts. The only way of avoiding this is to reserve a key for system wide use. If this is not done, the problem will only get worse as more and more applications are added to Haiku.

Another benefit of reserving a key for system wide use is that it will be more logical and easier to understand; everything with the reserved key is a system wide shortcut, everything without is for the active application.

Why not reply on the list? the involved parties are not here neccesarily.

Anyone interested in changing shortcuts may want to grab the list of current shhortcuts linked above and insert the needed changes.

It’s not easy to avoid collisions and still be consistent. For example, we currently have OPT to initiate S&T. Also to switch between tabs in a stacked group or between the apps of the current workspace with OPT + cursor.
We have CTRL+ALT plus various keys to hide, zoom and do other window related stuff.
CTRL+ALT+ cursor changes workspaces spatially.

Just replacing CTRL+ALT with OPT won’t cut it.

Without predefined guidelines it is very difficult, not to say impossible. Without rules, adding any new shortcut can collide with an existing application.

Example:

ALT Fx → OPT Fx
CTRL ALT ← / → / ↑ / ↓ → OPT ALT ← / → / ↑ / ↓
OPT → OPT (no change)
OPT↑ / ↓ → OPT↑ / ↓ (no change)
CTRL ALT + left/right mouse → OPT + left/right mouse
CTRL ALT Z/M/H/… → OPT ALT Z/M/H/… (some of them can be remapped to OPT without ALT, like M/H since they do not collide like Z do with Undo/Redo)
CTRL TAB → OPT TAB
CTRL ALT DEL → OPT ALT DEL
ALT ESC → OPT ESC
ALT C/X/V/W/Q/… → OPT C/X/V/W/Q/… (like on a Mac)
PRINT → OPT PRINT (screenshot)
SHIFT PRINT → OPT SHIFT PRINT
CTRL PRINT → OPT CTRL PRINT

OPT BACKSPACE has to be removed. ALT BACKSPACE already exists for the same functionality.
OPT DEL has to be removed. ALT DEL already exists for the same functionality.
OPT ← / → has to be removed. ALT ← / → already exists for the same functionality.
OPT in Tracker while opening a folder → ALT or CTRL

This opens up for a lot of standardized shortcuts without risking collisions with application shortcuts.

Example:

OPT P → Open print dialogue
OPT SHIFT P → Print using default printer (without opening the print dialogue)
OPT P 1 → Open print dialogue, select printer 1
OPT SHIFT P 1 → Print using printer 1 (without opening the print dialogue)

OPT V → Paste
OPT SHIFT V → Paste raw (remove formatting)
OPT C → Copy
OPT Z → Undo
OPT SHIFT Z → Redo

I have OPT SPACE mapped to start QuickLaunch.

Probably the best long solution here is to add a bit of abstraction and have all major keyboard-controlled OS behavior moved into a redesigned Shortcuts preferences rather than be hard-coded. Then a user could map things however they choose. This would also expose some current behaviors as new BMessages which would then be useful for scripting.

The main drawback would be some increased code complexity and possibly a slight bit of input latency depending on how it is implemented, though that probably isn’t a valid concern.

8 Likes

Mailing list user experience is terrible. freelists web site design is also terrible.

6 Likes

Pretty sure I’ve told you this before, but that is not an excuse.

For my part I’m just going to ignore whatever is written in this thread in relation to my ticket. either respond to the ticket or the mailing list post, I have no interest to have to discuss stuff over multiple platforms.

1 Like

Much more people will ignore mailing lists or even not know that such thing exist. Forcing people to use obsolete and hard to use tool is counter-productive.

9 Likes

It would be great if haiku-development was on gmane, but I can’t find it.
Anyone want to bug Lars into archiving it?

I have written an example of a guideline for shortcuts. Please comment what you think about it.


KEYBOARD MAPPING GUIDELINES


Keyboard shortcuts should be;

- Intuitive

  Keyboard shortcuts should be intuitive and easy to remember. The functions should primarily be mapped to the key with its first character or already established key. Shortcuts should not be mapped to keys that are not intuitive or where the key do not always exist (such as {}, which are not separate keys on most non-English keyboards).

  Do not copy bad behavior. Already established shortcuts should only be used if they are intuitive.

  OPT Z/X/C/V should be mapped to Undo/Cut/Copy/Paste because they are already established keys and are intuitive (closest to the modifier keys).

  CTRL/ALT Z could be mapped to a zooming function because it is intuitive (Z = zoom).


- Consistent
  
  The shortcuts should be consistent throughout the system. Consistency has precedence over already established functions.


- Discoverable

  Shortcut keys should be discoverable. For example the shortcut key combinations should be displayed in the menus and in the documentation.


MODIFIER KEY RULES


The OPT key is reserved for system defined shortcuts and is its primary key. Applications may not use the OPT key, and system defined shortcuts must use the OPT key.


The CTRL key is the primary key for application defined shortcuts, and the third key for system defined shortcuts.

  CTRL Z -> Zoom in content inside a window or view.

  CTRL SHIFT Z -> Zoom out content inside a window or view.

  OPT ALT Z -> Zoom window.

  OPT CTRL Z -> Zoom window group (Stack & Tile).

  OPT CTRL ALT Z -> Fourth zoom function, for example zoom Workspace.

  Since OPT Z is the primary function and mapped to Undo/Redo and OPT ALT Z is mapped to zoom a window then the CTRL key is used to map the shortcut to the third function of zooming a window group. A fourth function could be mapped to OPT CTRL ALT Z.


The ALT key is the secondary key modifier to select an alternative function of a shortcut.

  OPT ALT Z -> Zoom window.

  Since the primary function of OPT Z is mapped to Undo/Redo, the ALT key is used for the alternative function of zooming a window.


The SHIFT keys are the primary key to select alternative behavior of a shortcut.

  OPT Z -> Undo.
  OPT SHIFT Z -> Redo.

  Undo and Redo are alternative behaviors of the same function (step forwards or backwards in history) and therefor the SHIFT key is used.


The ALT GR key is reserved for typing alternative characters or graphics. It should not be used as a shortcut key.


The Fx keys without modifier are reserved for applications. Since not all keyboards have function keys, alternative shortcuts should be defined.

  F5 -> Reload in WebPositive.
  CTRL R -> Reload in WebPositive.


The FN key is reserved for controlling computer functions where such are supported. The mapping is hardware specific.

  FN F4 -> Sleep on IBM/Lenovo Thinkpads (currently not supported in Haiku).
  FN F3 -> Expose on newer Apple keyboards (currently not supported in Haiku).


Other non-standard keys should primarily be mapped to take on the above modifier keys if such a key is missing, and secondarily as their intended function.
  
  Sun left and right META should be mapped to left and right OPT.
  Sun COMPOSE should be mapped to its intended function of composing characters.


LEFT AND RIGHT MODIFIER KEYS

Shortcuts should not distinguish between left and right modifier keys. Applications should be able to distinguish between left and right modifier keys when not used as shortcuts. For example, VirtualBox uses the right CTRL as the HOST key, and some IBM terminal emulators uses the right CTRL as ENTER (which is a separate key from the RETURN key on old terminal keyboards). Sun keyboards do not have a right CTRL but a right OPT, which applications could use as a right CTRL in the above examples.


SHORTCUT PRECEDENCE

Shorter shortcuts have precedence over longer ones. The most common used functions have precedence over less used ones. 

The precedence is:

  PRIMARY_MODIFIER

  OPT
  CTRL

  PRIMARY_MODIFIER ALT

  OPT ALT
  CTRL ALT

  PRIMARY_MODIFIER SECONDARY_MODIFIER

  OPT CTRL

  PRIMARY_MODIFIER SECONDARY_MODIFIER ALT

  OPT CTRL ALT
  CTRL ALT

Undo/Redo have precedence over zoom, since Undo/Redo are commonly used functions.

Since SHIFT is used to alter the behavior of a function, and not for a different function, it has no precedence as such. 

  OPT Z -> Undo
  OPT SHIFT Z -> Redo (Correct! Redo is an alternative behavior of Undo and uses the same modifier as Undo plus SHIFT).
  OPT ALT Z -> Redo (Wrong! Redo is an alternative behavior of Undo and should not be mapped to another modifier key than Undo).


SHORTCUT KEY ORDER

The shortcut key order which keys are displayed [in the UI and documentation] is based on their logical function precedence. This differs from the common order based on their physical placement on the keyboard that systems like Windows and macOS use. Logical order is more intuitive and therefor easier to remember than physical placement on a keyboard, which can vary between keyboards.

  The OPT key is the primary modifier key when used, and should be ordered first.

  The CTRL key is the primary key when OPT is not used, and should be ordered after OPT.

  The ALT key is the primary key when CTRL is not used, and should be ordered after CTRL.

  The SHIFT key is the primary key to select an alternative behavior of a shortcut and should be ordered before KEY.

  The KEY key should be ordered last.

  Note: KEY do not have to be a keyboard key. It can be a mouse click or touch pad input.

This gives the order of:

  OPT CTRL ALT SHIFT KEY

If multiple KEY keys are to be supported, the secondary KEY(s) should be displayed after the primary KEY.

  OPT CTRL ALT SHIFT KEY [KEY...]

    OPT P 2 -> Open the print dialogue and select the second printer.
    OPT SHIFT P 2 -> Print using the second printer without opening the print dialogue.
1 Like

I believe undo, unlike copy, cut and paste, is an application feature (as opposed to a system feature).

What wrong with Alt as command key?

It’s an alternative key (ALT). Command/Win is the command key (OPT). CTRL is the Control key.

Nothing will stop the user from remapping OPT to ALT if that is what they prefer.

On Mac. But Haiku is not Mac and it don’t need to mimic Mac.

On Haiku there are no Alt key, it is called command key (but nobody manufacture keyboards for Haiku for now where Alt is labeled Cmd). Opt key can be used instead Alt if needed.

4 Likes

Haiku uses the Apple (“Mac”) layout today. I have not changed that.

I have used the naming used in the Haiku documentation. It defines ALT, CTRL and OPT. I see those as logical functions mapped to physical keys.

On a “PC” keyboard ALT is the Alt key, CTRL is the Ctrl key and OPT is the Win key.

On Apple keyboard ALT is the Option key, CTRL is the Ctrl key and OPT is the Command key.

“PC” keyboards and Apple keyboards have ALT and OPT swapped. That is one of the reasons why I wrote the guidelines from a logical perspective and not from a physical placement perspective; the physical placement can vary. Haiku already supports mapping OPT, CTRL and ALT to any physical key and many users chose to do so.

I forgot to add ALT in the precedence list. ALT is second in the precedence, after PRIMARY_MODIFIER but before PRIMARY_MODIFIER with ALT. I also have renamed ALT to ALT_MODIFIER. That means ALT Z is a valid shortcut for applications to use.

ALT (ALT Z) is second in the list because shorter shortcuts have precedence over longer ones, which places it after PRIMARY_MODIFIER (OPT Z or CTRL Z) since primary modifiers have precedence over alternative ones, but before PRIMARY_MODIFIER ALT_MODIFIER (OPT ALT Z or CTRL ALT Z) which is a primary but longer.

For what it worth… If my memories are correct, there was a pic of a keyboard with leaves keys on this forum but I can’t remember on which thread it was.