[squeak-dev] The Inbox: Morphic-ct.1786.mcz

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Wed Oct 20 13:53:04 UTC 2021


Done:
https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/42#issuecomment-947689830
This version can be moved to treated.

Best,
Christoph

---
Sent from Squeak Inbox Talk

On 2021-10-20T09:08:06+02:00, marcel.taeumel at hpi.de wrote:

> There are open input event issues on GitHub. Maybe add a comment there or open a new ticket.
> 
> Best,
> Marcel
> Am 19.10.2021 19:39:18 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
> Hi Marcel,
> 
> 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? :-)
> 
> Best,
> Christoph
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
> Gesendet: Dienstag, 19. Oktober 2021 15:36:08
> An: squeak-dev
> 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.
> 
> Best,
> Marcel
> 
> 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:
> http://source.squeak.org/inbox/Morphic-ct.1786.mcz
> 
> ==================== Summary ====================
> 
> Name: Morphic-ct.1786
> Author: ct
> Time: 18 October 2021, 5:52:25.059559 pm
> UUID: 322e30d5-aa3f-cb45-843c-c01bf40a00a1
> Ancestors: Morphic-ul.1780
> 
> 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].
> -
> "Search field."
> aKeyboardEvent keyCharacter = $0
> ifTrue: [
> self searchBarMorph ifNotNil: [ :morph |
> morph model activate: aKeyboardEvent in: morph ].
> ^ aKeyboardEvent ignore "hit!!"].
> 
> "Select menu items."
> (aKeyboardEvent keyValue
> between: $1 asciiValue
> and: $9 asciiValue)
> ifFalse: [^ aKeyboardEvent].
> 
> index := aKeyboardEvent keyValue - $1 asciiValue + 1.
> itemToSelect := (self submorphs select: [ :each |
> each isMenuItemMorph ])
> at: index
> ifAbsent: [^ aKeyboardEvent].
> +
> -
> self activate: aKeyboardEvent.
> self
> selectItem: itemToSelect
> event: aKeyboardEvent.
> +
> -
> ^ aKeyboardEvent ignore "hit!!"!
> 
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211020/a65c435e/attachment.html>
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211020/74d25441/attachment.html>


More information about the Squeak-dev mailing list