[squeak-dev] The Inbox: Morphic-ct.1786.mcz
marcel.taeumel at hpi.de
Wed Oct 20 07:08:06 UTC 2021
There are open input event issues on GitHub. Maybe add a comment there or open a new ticket.
Am 19.10.2021 19:39:18 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
alright, this looks indeed like a bug in the (Windows) VM. Hm ... Is there any central place where we are tracking open keyboard handling problems? Maybe we should collect them in an OSVM issue? :-)
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Dienstag, 19. Oktober 2021 15:36:08
Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1786.mcz
Note that shortcuts implemented via EventKeyChar (or #keyStroke:) use #keyCharacter and should therefore not be combined with #shiftPressed since the SHIFT-key actually modifiers the character delivered. Just use #keyCharacter and the other modifiers (e.g., #controlPressed or #commandPressed).
In this example, SHIFT seems to be ignored in the VM when CTRL is pressed. SHIFT+1 yields $! but CTRL+SHIFT+1 yields $1. This is clearly a bug in the VM.
So, I would rather not make the change as proposed here.
P.S.: Note that this is not the minimal change you could have made to this method to propose your fix. By merging the two checks into a more complex condition, you impaired readability a little bit. At least through my eyes. I would have probably just added a check for #shiftPressed below #isKeystroke and also added some commentary on what the bug here is.
Am 18.10.2021 17:52:43 schrieb commits at source.squeak.org <commits at source.squeak.org>:
A new version of Morphic was added to project The Inbox:
==================== Summary ====================
Time: 18 October 2021, 5:52:25.059559 pm
Do not invoke docking bar menu via Ctrl + Shift + . Keep this shortcut available for others morphs.
=============== Diff against Morphic-ul.1780 ===============
Item was changed:
----- Method: DockingBarMorph>>filterEvent:for: (in category 'events-processing') -----
filterEvent: aKeyboardEvent for: anObject
"Provide keyboard shortcuts."
| index itemToSelect |
+ (aKeyboardEvent isKeystroke and: [aKeyboardEvent controlKeyPressed] and: [aKeyboardEvent shiftPressed not])
- aKeyboardEvent controlKeyPressed
ifFalse: [^ aKeyboardEvent].
- aKeyboardEvent isKeystroke
- ifFalse: [^ aKeyboardEvent].
aKeyboardEvent keyCharacter = $0
self searchBarMorph ifNotNil: [ :morph |
morph model activate: aKeyboardEvent in: morph ].
^ aKeyboardEvent ignore "hit!!"].
"Select menu items."
between: $1 asciiValue
and: $9 asciiValue)
ifFalse: [^ aKeyboardEvent].
index := aKeyboardEvent keyValue - $1 asciiValue + 1.
itemToSelect := (self submorphs select: [ :each |
each isMenuItemMorph ])
ifAbsent: [^ aKeyboardEvent].
self activate: aKeyboardEvent.
^ aKeyboardEvent ignore "hit!!"!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev