Show hardcoded TAStudio keybinds as disabled entries in Hotkey config
(Or as proper entries, if it's feasible for any actions to be bound to arbitrary keys.)
see also #1399, #3556
Is there a particular reason certain keybinds couldn't be rebound? Is it just a matter of moving them out of designer files, or something else? It would make sense for WinForms-mandated UI inputs (Alt-based navigation, etc.), but are there other circumstances that prevent rebinding?
I think I have an old (unsent) PR that was trying to make some hardcoded inputs configurable, so I'm going to have a look.
Is there a particular reason certain keybinds couldn't be rebound?
No reason.
The main problem is that everything is hardcoded. With effort I'm sure it could all be disentangled and made rebindable, but then you would find that some actions mirror native Win32 UI behaviour, like Shift as a modifier to select a range and Ctrl to add/remove from the selection. I think those specifically are already part of our InputRoll reimplementation but maybe we don't want to allow rebinding things like that. Needs more thought.
Which specific actions are currently hardcoded, that might benefit from rebinding?
Anything that isn't a mouse button or a mouse button + modifiers. A grep found 20-ish.
TAStudio.cs: ShortcutKeys = Keys.Control | Keys.G,
TAStudio.cs: if (keyData is Keys.Tab or (Keys.Shift | Keys.Tab) or Keys.Space) return true;
TAStudio.ListView.cs: EditAnalogProgrammatically(new KeyEventArgs(Keys.Up));
TAStudio.ListView.cs: EditAnalogProgrammatically(new KeyEventArgs(Keys.Down));
TAStudio.ListView.cs: EditAnalogProgrammatically(new KeyEventArgs(Keys.Up | Keys.Shift));
TAStudio.ListView.cs: EditAnalogProgrammatically(new KeyEventArgs(Keys.Down | Keys.Shift));
TAStudio.ListView.cs: EditAnalogProgrammatically(new KeyEventArgs(Keys.Right));
TAStudio.ListView.cs: EditAnalogProgrammatically(new KeyEventArgs(Keys.Left));
TAStudio.ListView.cs: if (e.KeyCode == Keys.Right)
TAStudio.ListView.cs: else if (e.KeyCode == Keys.Left)
TAStudio.ListView.cs: else if (e.KeyCode is Keys.OemMinus or Keys.Subtract)
TAStudio.ListView.cs: else if (e.KeyCode == Keys.Back)
TAStudio.ListView.cs: else if (e.KeyCode == Keys.Enter)
TAStudio.ListView.cs: else if (e.KeyCode == Keys.Escape)
TAStudio.ListView.cs: if (e.KeyCode == Keys.Up)
TAStudio.ListView.cs: else if (e.KeyCode == Keys.Down)
TAStudio.ListView.cs: if (e.IsShift(Keys.Home))
TAStudio.ListView.cs: else if (e.IsShift(Keys.End))
TAStudio.ListView.cs: && e.KeyCode != Keys.Right
TAStudio.ListView.cs: && e.KeyCode != Keys.Left
TAStudio.ListView.cs: && e.KeyCode != Keys.Up
TAStudio.ListView.cs: && e.KeyCode != Keys.Down)
TAStudio.Designer.cs: this.OpenTASMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
TAStudio.Designer.cs: this.SaveTASMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
TAStudio.Designer.cs: this.SaveAsTASMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
TAStudio.Designer.cs: | System.Windows.Forms.Keys.S)));
TAStudio.Designer.cs: this.CopyMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
TAStudio.Designer.cs: this.PasteMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
TAStudio.Designer.cs: this.PasteInsertMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
TAStudio.Designer.cs: | System.Windows.Forms.Keys.V)));
TAStudio.Designer.cs: this.CutMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
TAStudio.Designer.cs: this.StateHistoryIntegrityCheckMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
TAStudio.Designer.cs: | System.Windows.Forms.Keys.I)));
Should probably be implemented:
ShortcutKeys = Keys.Control | Keys.G
Go To Frame
else if (e.KeyCode == Keys.Enter) else if (e.KeyCode == Keys.Escape)
Leave axis editing mode, either accepting or cancelling any edits made.
this.PasteInsertMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.V)));
Paste insert.
Things that should be fixed:
TAStudio.cs: if (keyData is Keys.Tab or (Keys.Shift | Keys.Tab) or Keys.Space) return true;
This seems to just prevent users from using tab+space to select and activate controls. I have no idea why this is there, it seems like it should just be removed. With a 3-second test, doing so appears to be a good improvement.
False positives in your search:
Everything with EditAnalogProgrammatically and anything mentioning an arrow key. Those are axis edit actions and do have hotkeys.
Questionable if they should be implemented:
(e.KeyCode is Keys.OemMinus or Keys.Subtract)
This is for typing a minus in axis editing mode. It also flips the sign of the current typed value, which could perhaps be a hotkey.
if (e.IsShift(Keys.Home)) else if (e.IsShift(Keys.End))
These go to frame 0 and the last frame of the movie. I would think that other actions adequately fulfill this purpose. (Go To Frame, or go to marker, or any other way of navigating) Does anybody use these?
TAStudio.Designer.cs: this.OpenTASMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); TAStudio.Designer.cs: this.SaveTASMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); TAStudio.Designer.cs: this.SaveAsTASMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.S))); TAStudio.Designer.cs: this.CopyMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); TAStudio.Designer.cs: this.PasteMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); TAStudio.Designer.cs: this.CutMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
Standard shortcut keys across many Windows applications. Open, Save, Save As, Copy, Paste, Cut. We have customizable open and save hotkeys for the main form, but not other tools. I think it would make sense to have all tools share the same option, if we do make this configurable.
TAStudio.Designer.cs: this.StateHistoryIntegrityCheckMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.I))); This option is only available in debug mode.
Should not be implemented:
else if (e.KeyCode == Keys.Back)
That's just backspace when typing an axis value.
I've looked at this some in #4516 . That PR could probably be submitted as is, but there were a few more tweaks I was meaning to do before I got sidetracked on some other projects.
I've also been following recent discussions about this.