-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
36 additions
and
7 deletions.
There are no files selected for viewing
7 changes: 4 additions & 3 deletions
7
packages/Algernon.package/ALGCore.class/class/initializeGlobalKeyBindings.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
initialization | ||
initializeGlobalKeyBindings | ||
|
||
KeyBindings := Dictionary newFrom: | ||
{ '<down>' -> [:anEvent :morph | morph selectNext]. | ||
'<up>' -> [:anEvent :morph | morph selectPrevious]. | ||
'<tab>' -> [:anEvent :morph | morph showChildListOrDoAction: anEvent]. | ||
'<tab>' -> [:anEvent :morph | morph showChildListOrDoAction: anEvent]. | ||
'<Shift-tab>' -> [:anEvent :morph | morph showParentList]. | ||
'<escape>' -> [:anEvent :morph | morph deactivate: anEvent hand]. | ||
'<cr>' -> [:anEvent :morph | morph doActionOnSelectedEvent:anEvent] } | ||
'<cr>' -> [:anEvent :morph | morph doActionOnSelectedEvent: anEvent]. | ||
'<Ctrl-delete>' -> [:anEvent :morph | morph clearSearchBar: anEvent] } |
10 changes: 10 additions & 0 deletions
10
packages/Algernon.package/ALGCore.class/instance/clearSearchBar..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
events-processing | ||
clearSearchBar: event | ||
|
||
self active | ||
ifTrue: [ | ||
self query: ''. | ||
self resetFilteringThreshold. | ||
self isStepping ifFalse: [self startStepping]. | ||
self grabFocus: self activeHand] | ||
|
3 changes: 2 additions & 1 deletion
3
packages/Algernon.package/ALGCore.class/instance/grabFocus..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
event handling | ||
grabFocus: hand | ||
|
||
hand | ||
newKeyboardFocus: self textField. | ||
newKeyboardFocus: self textField |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...ages/AlgernonTests.package/ALGTestKeyboard.class/instance/testShortcutToClearSearchBar.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
testing | ||
testShortcutToClearSearchBar | ||
| sampleKeyboardEvent deleteKeyboardEvent | | ||
sampleKeyboardEvent := ALGFakeKeyboardEvent new keyString: 'A'; | ||
keyValue: 65; | ||
buttons: 0; | ||
isKeyUp: true. | ||
deleteKeyboardEvent := ALGFakeKeyboardEvent new keyString: '<Ctrl-delete>'. | ||
self algInstance keyStroke: sampleKeyboardEvent. | ||
self algInstance keyStroke: sampleKeyboardEvent. | ||
self assert: self algInstance query equals: 'AA'. | ||
self algInstance keyStroke: deleteKeyboardEvent. | ||
self assert: self algInstance query equals: '' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters