Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental solution for step through interpreting the full flow issue #16351 #17308

Draft
wants to merge 26 commits into
base: Pharo13
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1c93efa
Using unknownBytecode to improve the step through implementation
tesonep Oct 12, 2024
03b5a96
Fixing critics
tesonep Oct 12, 2024
6b05d8d
SDL2: Ignore repeated events
iglosiggio Oct 18, 2024
b39e71b
Instead of removing all repeat events just try to match with and with…
iglosiggio Oct 18, 2024
73d4ec0
Rename the argument to KeyboardEvent>>#isRepeat:
iglosiggio Oct 19, 2024
10a2336
isRepeat is `false` by default for KeyboardEvent-s
iglosiggio Oct 21, 2024
596aa40
Merge 73d4ec066d4db585d246331a66ab4b8f2391116f
iglosiggio Oct 21, 2024
b27b2a4
Improvements in undo/redo
guillep Oct 21, 2024
32472c6
Add a test for the new behavior of the dispatcher
iglosiggio Oct 21, 2024
4644c40
Temporarily creating tests for stepping through using the EnhancedDeb…
carolahp Oct 21, 2024
238aaf5
Merge pull request #17305 from guillep/undo-fixes
Ducasse Oct 22, 2024
9b55ea4
Merge pull request #17301 from iglosiggio/fixup-repeat-events
Ducasse Oct 22, 2024
4de0deb
Major update of the Keymap Descriptions to a first version of a Short…
hernanmd Oct 23, 2024
2beea03
Update KMDescriptionPresenter.class.st
hernanmd Oct 23, 2024
3fc240c
Do not use method extensions for Commander activations
Oct 25, 2024
98c493a
Updated dependencies
hernanmd Oct 25, 2024
742a8bb
Fix typo in "heigh"
koendehondt Oct 25, 2024
005f866
Merge pull request #17317 from koendehondt/gh17229
MarcusDenker Oct 25, 2024
ca55b77
Merge pull request #17311 from hernanmd/p13-enh-shortcuts-editor
jecisc Oct 26, 2024
e4a87e7
Merge 4644c40ec9adc14176e5fe48adbf40509eddc754
tesonep Oct 31, 2024
5b99683
Adding more tests to the EnhancedDebugSession
tesonep Oct 31, 2024
679822c
- Adding more tests
tesonep Nov 8, 2024
3422804
The Bytecode interpreter should do the same that the VM, it should no…
tesonep Nov 12, 2024
cd6d853
Adding a test using a block in another process
tesonep Nov 15, 2024
5d96818
Adding implementation with HaltingBlock
tesonep Nov 15, 2024
450b838
Halting only if we are stepping
tesonep Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Keymapping-Core/KMDispatchChain.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,16 @@ KMDispatchChain class >> from: anInitialTarget andDispatcher: aDispatcher [
{ #category : 'dispatching' }
KMDispatchChain >> dispatch: aKeyboardEvent [
self do: [ :targetToDispatch |
targetToDispatch dispatch: KMBuffer uniqueInstance buffer copy.
| sequence |
sequence := KMBuffer uniqueInstance buffer copy.
targetToDispatch dispatch: sequence.
aKeyboardEvent wasHandled ifTrue: [ ^self ].
"Let's try to match this sequence of events again.
This time ignoring any repeated events."
sequence removeAllSuchThat: [ :ev | ev isRepeat ].
sequence isNotEmpty ifTrue: [
targetToDispatch dispatch: sequence.
aKeyboardEvent wasHandled ifTrue: [ ^self ] ]
].
"This should be a noMatch event"
aKeyboardEvent wasHandled ifFalse: [ KMBuffer uniqueInstance clearBuffer ]
Expand Down
40 changes: 40 additions & 0 deletions src/Keymapping-Tests/KMDispatcherTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,43 @@ KMDispatcherTest >> testNoStaggeredTrigger [
self deny: flag1.
self assert: flag2
]

{ #category : 'tests' }
KMDispatcherTest >> testRepeatEvents [
| morph flag category pressA repeatPressA pressB repeatPressB pressC |
category := KMCategory named: #TestBlah.
KMRepository default addCategory: category.

morph := BorderedMorph new.
morph kmDispatcher reset.
flag := false.

category addKeymapEntry: (KMKeymap named: #Foo shortcut: $a asKeyCombination, $b asKeyCombination, $c asKeyCombination action: [flag := true]).
morph attachKeymapCategory: #TestBlah.

pressA := self eventKey: $a.
morph kmDispatcher dispatchKeystroke: pressA.
self assert: morph kmDispatcher buffer asArray equals: {pressA}.

repeatPressA := (self eventKey: $a) isRepeat: true; yourself.
morph kmDispatcher dispatchKeystroke: repeatPressA.
self assert: morph kmDispatcher buffer asArray equals: {pressA. repeatPressA}.
self assert: (morph kmDispatcher buffer asArray collect: [ :v | v isRepeat ]) equals: {false. true}.

pressB := self eventKey: $b.
morph kmDispatcher dispatchKeystroke: pressB.
self assert: morph kmDispatcher buffer asArray equals: {pressA. repeatPressA. pressB}.
self assert: (morph kmDispatcher buffer asArray collect: [ :v | v isRepeat ]) equals: {false. true. false}.

repeatPressB := (self eventKey: $b) isRepeat: true; yourself.
morph kmDispatcher dispatchKeystroke: repeatPressB.
self assert: morph kmDispatcher buffer asArray equals: {pressA. repeatPressA. pressB. repeatPressB}.
self assert: (morph kmDispatcher buffer asArray collect: [ :v | v isRepeat ]) equals: {false. true. false. true}.

pressC := self eventKey: $c.
morph kmDispatcher
dispatchKeystroke: pressC.
self assert: morph kmDispatcher buffer isEmpty.

self assert: flag
]
18 changes: 16 additions & 2 deletions src/Morphic-Core/KeyboardEvent.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Class {
'charCode',
'scanCode',
'key',
'supressNextKeyPress'
'supressNextKeyPress',
'isRepeat'
],
#category : 'Morphic-Core-Events',
#package : 'Morphic-Core',
Expand Down Expand Up @@ -53,7 +54,8 @@ KeyboardEvent >> hash [
KeyboardEvent >> initialize [

super initialize.
supressNextKeyPress := false
supressNextKeyPress := false.
isRepeat := false
]

{ #category : 'testing' }
Expand Down Expand Up @@ -81,6 +83,18 @@ KeyboardEvent >> isMouseMove [
^false
]

{ #category : 'accessing' }
KeyboardEvent >> isRepeat [

^ isRepeat
]

{ #category : 'accessing' }
KeyboardEvent >> isRepeat: aBoolean [

isRepeat := aBoolean
]

{ #category : 'keyboard' }
KeyboardEvent >> key [
^ key ifNil: [key := Smalltalk os keyForValue: keyValue]
Expand Down
6 changes: 4 additions & 2 deletions src/OSWindow-Core/OSWindowMorphicEventHandler.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ OSWindowMorphicEventHandler >> visitKeyDownEvent: anEvent [
stamp: Time millisecondClockValue.
keyEvent
scanCode: anEvent scanCode;
key: (OSKeySymbols mapKeySymbolValueToKeyboardKey: anEvent symbol).
key: (OSKeySymbols mapKeySymbolValueToKeyboardKey: anEvent symbol);
isRepeat: anEvent repeat = 1.
self dispatchMorphicEvent: keyEvent
]

Expand All @@ -237,7 +238,8 @@ OSWindowMorphicEventHandler >> visitKeyUpEvent: anEvent [
stamp: Time millisecondClockValue.
keyEvent
scanCode: anEvent scanCode;
key: (OSKeySymbols mapKeySymbolValueToKeyboardKey: anEvent symbol).
key: (OSKeySymbols mapKeySymbolValueToKeyboardKey: anEvent symbol);
isRepeat: anEvent repeat = 1.
^ keyEvent
]

Expand Down