2023-10-28 23:56:34 +00:00
|
|
|
package funkin.ui.debug.charting.handlers;
|
|
|
|
|
|
|
|
import funkin.util.PlatformUtil;
|
|
|
|
|
|
|
|
@:access(funkin.ui.debug.charting.ChartEditorState)
|
|
|
|
class ChartEditorShortcutHandler
|
|
|
|
{
|
|
|
|
public static function applyPlatformShortcutText(state:ChartEditorState):Void
|
|
|
|
{
|
2023-11-24 05:42:07 +00:00
|
|
|
state.menubarItemNewChart.shortcutText = ctrlOrCmd('N');
|
|
|
|
state.menubarItemOpenChart.shortcutText = ctrlOrCmd('O');
|
|
|
|
state.menubarItemSaveChartAs.shortcutText = ctrlOrCmd(shift('S'));
|
|
|
|
state.menubarItemExit.shortcutText = ctrlOrCmd('Q');
|
|
|
|
|
|
|
|
state.menubarItemUndo.shortcutText = ctrlOrCmd('Z');
|
|
|
|
state.menubarItemRedo.shortcutText = ctrlOrCmd('Y');
|
|
|
|
state.menubarItemCut.shortcutText = ctrlOrCmd('X');
|
|
|
|
state.menubarItemCopy.shortcutText = ctrlOrCmd('C');
|
|
|
|
state.menubarItemPaste.shortcutText = ctrlOrCmd('V');
|
|
|
|
|
|
|
|
state.menubarItemSelectAll.shortcutText = ctrlOrCmd('A');
|
|
|
|
state.menubarItemSelectInverse.shortcutText = ctrlOrCmd('I');
|
|
|
|
state.menubarItemSelectNone.shortcutText = ctrlOrCmd('D');
|
|
|
|
state.menubarItemSelectBeforeCursor.shortcutText = shift('Home');
|
|
|
|
state.menubarItemSelectAfterCursor.shortcutText = shift('End');
|
|
|
|
|
|
|
|
state.menubarItemDifficultyDown.shortcutText = ctrlOrCmd('←');
|
|
|
|
state.menubarItemDifficultyUp.shortcutText = ctrlOrCmd('→');
|
|
|
|
|
|
|
|
state.menubarItemPlaytestFull.shortcutText = 'Enter';
|
|
|
|
state.menubarItemPlaytestMinimal.shortcutText = shift('Enter');
|
2023-10-28 23:56:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Display `Ctrl` on Windows and `⌘` (Command) on macOS.
|
|
|
|
* @param input
|
|
|
|
*/
|
|
|
|
static inline function ctrlOrCmd(input:String)
|
|
|
|
{
|
|
|
|
return (PlatformUtil.isMacOS()) ? '⌘+${input}' : 'Ctrl+${input}';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Display `Ctrl` on Windows and `^` (Control) on macOS.
|
|
|
|
* @param input
|
|
|
|
*/
|
|
|
|
static inline function ctrl(input:String)
|
|
|
|
{
|
|
|
|
return (PlatformUtil.isMacOS()) ? '^+${input}' : 'Ctrl+${input}';
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline function alt(input:String)
|
|
|
|
{
|
|
|
|
return (PlatformUtil.isMacOS()) ? '⌥+${input}' : 'Alt+${input}';
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline function shift(input:String)
|
|
|
|
{
|
|
|
|
return (PlatformUtil.isMacOS()) ? '⇧+${input}' : 'Shift+${input}';
|
|
|
|
}
|
|
|
|
}
|