--- a/DeviceWorkstation.st Thu Feb 09 00:17:19 2017 +0000
+++ b/DeviceWorkstation.st Sun May 14 21:48:34 2017 +0200
@@ -609,6 +609,173 @@
defaultButtonPressTimeForMenu:seconds
DefaultButtonPressTimeForMenu := seconds
+!
+
+defaultKeyboardMapDefinition
+ "
+ Return a default shortcut bindings. See comment in
+ KeyboardMap >> loadKeyboardMapDefinition: for the description of definition
+ format."
+
+ ^ #(
+"/ Logical Shortcut Aliases Description
+"/ ================================================================================
+
+ ( Cmd Alt (Menu Mode_switch) )
+ ( Menu Cmdz (Appl CtrlAppl CmdAppl) 'Show context menu' )
+
+"/ ( Hardcopy #'Super_R' )
+ ( Alt #'Super_L' #'Hyper_R' )
+
+ ( UserInterrupt Break (#'Cmd.' #'Ctrl.') 'Interrupt - enter debugger' )
+ ( UserAbort CtrlBreak (CtrlCancel CtrlPause CmdY) 'Abort - do not enter debugger' )
+ ( FlushInput CtrlX 'Flush (trow away) typeahead input' )
+
+"/ ( DestroyView CmdCtrlX )
+ ( DestroyTopView CmdCtrlX )
+
+"/ ( CloseWindowRequest CmdF4 'Close active window' )
+
+ ( DoIt Cmdd Ctrld 'DoIt - evaluate expression' )
+ ( InspectIt Cmdi Ctrlq 'InspectIt - evaluate expression and inspect result')
+ ( PrintIt Cmdp Ctrlp 'PrintIt - evaluate expression and print result')
+ ( ReplaceIt CmdP 'Replace selection with result of expression evaluation')
+
+ ( BrowseIt CmdB CtrlB 'Evaluate expression and browse result''s class')
+ ( ImplementorsOfIt CtrlI CmdI 'Browse implementors of selected selector')
+"/ ( SendersOfIt CtrlS CmdS 'Browse senders of selected selector')
+
+
+"/ Logical Shortcut Aliases Description
+"/ ===========================================================
+
+ ( ToggleInsertMode AltInsert )
+
+ ( Cut Ctrlx Cmdx 'Cut' )
+ ( Copy Ctrlc (Cmdc CtrlInsert) 'Copy' )
+ ( Paste Ctrlv (Cmdv ShiftInsert) 'Paste' )
+
+ ( PasteFromHistory CtrlV CmdV )
+
+ ( Replace Cmdr Ctrlr 'Replace' )
+ ( Join Cmdj Ctrlj )
+
+ ( Find Ctrlf Cmds 'Search (open search dialog)' )
+ ( FindNext Cmdf 'Forward search (selection or previous search pattern)' )
+ ( FindPrev Cmdb Ctrlb 'Backward search (selection or previous search pattern)' )
+ ( SelectAll Ctrla CmdA 'Select all' )
+ ( GotoLine Ctrlg Ctrll 'Go to line' )
+ ( SelectWord Cmdw 'Select Word under cursor' )
+ ( Undo Ctrlz 'Undo last operation' )
+ ( Redo Ctrly 'Redo last operation' )
+ ( Accept Cmda Ctrls 'Accept / Save (compile or save)' )
+ ( SaveAs CmdS CtrlS 'Save as (a file)' )
+ ( Explain Cmde Cmdh 'Explain code' )
+ ( Format CmdF )
+
+
+"/ Logical Shortcut Aliases Description )
+"/ ===========================================================
+
+"/ ( DeleteLine CtrlX )
+ ( NextPage Next )
+ ( PreviousPage Prior )
+"/ ( HalfPageUp Ctrlu )
+"/ ( HalfPageDown Ctrld )
+ ( BeginOfLine Home 'Goto begin of line' )
+ ( BeginOfText CtrlHome 'Goto begin of whole text' )
+
+ ( EndOfLine End Ctrle 'Goto end of line' )
+ ( EndOfText CtrlEnd 'Goto end of whole text' )
+ ( EndOfWord CtrlW 'Goto end of word under cursor' )
+
+ ( NextWord CtrlCursorRight Ctrlw 'Move to next word' )
+ ( PreviousWord CtrlCursorLeft 'Move to previous word' )
+
+ ( ScrollUp CtrlCursorUp )
+ ( ScrollDown CtrlCursorDown )
+
+ ( SearchMatchingParent Ctrlm )
+ ( SelectMatchingParents Cmdm 'Select up to matching parenthesis' )
+
+ ( SelectToEnd CtrlE 'Select from end of text' )
+ ( SelectFromBeginning CtrlA 'Select from beginning of text' )
+ ( ExpandSelectionByLine Cmdl )
+ ( ExpandSelectionByWord CmdW )
+ ( DeleteWordBeforeCursor CtrlBackSpace )
+ ( Return KP_Enter )
+ ( Delete OK_Delete )
+
+"/ Logical Shortcut Aliases Description
+"/ ===========================================================
+ ( ZoomIn #'Ctrl+' )
+ ( ZoomOut #'Ctrl-' )
+ ( ZoomInAll #'Ctrl*' )
+ ( ZoomOutAll #'Ctrlunderscore' )
+
+ ( FocusNext CmdCursorRight (CmdCursorDown AltCursorRight AltCursorDown CmdTab))
+ ( FocusPrevious CmdCursorLeft (CmdCursorUp AltCursorLeft AltCursorUp #'CmdISO_Left_Tab'))
+
+ ( NonInsertingTab ShiftTab #'ISO_Left_Tab' )
+ ( BackTab CtrlTab )
+"/ ( ToggleTabs CtrlTab )
+
+ ( Help F1 'Help / Explain code' )
+ ( Rename F2 'Rename' )
+ ( CommentSelection F3 'Comment selection' )
+ ( UncommentSelection F4 'Uncomment selection' )
+"/ ( F5 )
+ (ConvertSelectionToLowercaseOrUppercaseOrUppercaseFirst
+ F6 'Selection to lowercase/UPPERCASE/UpperCaseFirst (toggle through)' )
+"/ ( F7 )
+ ( Again F8 'Again (repeat last cut/replace)' )
+ ( UndentBy4 F9 'Undent by 4 (move block to left)' )
+ ( IndentBy4 F10 'Indent by 4 (move block to right)' )
+ ( UndentBy1 F11 'Undent by 1 (move block to left)' )
+ ( IndentBy1 F12 'Indent by 4 (move block to right)' )
+
+ ( ParenthizeSelection #'Cmd(' 'Add parentheses around selection' )
+ ( UnparenthizeSelection #'Cmd)' 'Remove parentheses' )
+ ( LearnKeyboardMacro CmdL CtrlF2 'Enter/leave learn macro mode (CmdM) to replay macro)' )
+ ( ExecuteKeyboardMacro CmdM CmdF2 'Execute keyboard Macro (CMD-L to learn)' )
+
+ ( ConvertSelectionToUppercase
+ CtrlF6 'Selection to UPPERCASE' )
+ ( ExpandAbbreviation #'Cmd ' 'Insert Abbreviation (try <ALT-SPACE> behind the string ''it'')')
+ ( CodeCompletion #'Ctrl ' #'Ctrlspace' )
+
+
+"/ Logical Shortcut Aliases Description
+"/ ===========================================================
+
+"/ Following was used only on NON-macOS systems, not sure why. In case it
+"/ would cause problems, refactor. I cannot test now ans would like to make
+"/ the code simpler.
+
+ ( $[ #'Cmd[' #'Alt[' )
+ ( $] #'Cmd]' #'Alt]' )
+ ( $| #'Cmd|' #'Alt|' )
+ ( ${ #'Cmd{' #'Alt{' )
+ ( $} #'Cmd}' #'Alt}' )
+ ( $\ #'Cmd\' #'Alt\' )
+ ( $~ #'Cmd~' #'Alt~' )
+ ( $@ #'Cmd@' #'Alt@' )
+ ( $# #'Cmd#' #'Alt#' )
+
+ )
+ "
+ DeviceWorkstation defaultKeyboardMapDefinition.
+
+ Screen current
+ instVarNamed: #keyboardMap put: nil;
+ initializeKeyboardMap;
+ keyboardMap.
+
+ Screen current keyboardMap.
+ "
+
+ "Created: / 12-05-2017 / 21:51:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 14-05-2017 / 10:41:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!DeviceWorkstation class methodsFor:'error handling'!
@@ -6120,11 +6287,9 @@
!
initializeDefaultKeyboardMappingsIn:aKeyboardMap
- aKeyboardMap bindValue:#Copy to:#Cmdc. "copy selection to buffer"
- aKeyboardMap bindValue:#Cut to:#Cmdx. "cut selection into buffer"
- aKeyboardMap bindValue:#Paste to:#Cmdv. "paste buffer or external selection"
-
- aKeyboardMap bindValue:#UserInterrupt to:#Ctrlc. "interrupt window process"
+ aKeyboardMap loadKeyboardMapDefinition: self class defaultKeyboardMapDefinition.
+
+ "Modified: / 12-05-2017 / 21:55:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
initializeDefaultValues