The Trunk: Kernel-mt.1392.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-mt.1392.mcz

commits-2
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1392.mcz

==================== Summary ====================

Name: Kernel-mt.1392
Author: mt
Time: 25 April 2021, 12:05:33.297546 pm
UUID: 29af9533-b510-49d5-8bde-86666d35f486
Ancestors: Kernel-mt.1391

Small fix. On Linux, uses non-printable control characters when "map CTRL to CMD" is enabled but "map non-printable to printable" is disabled.

Due to limitations of physical modifier keys across platforms, this is not super important but it is nice to get consistent event data across platforms. I suppose that checking for non-printable control characters in keyboard handlers should be avoided to ensure cross-platform compatibility.

See commentary in KeyboardEvent >> #checkCommandKey for more information.

=============== Diff against Kernel-mt.1391 ===============

Item was changed:
  ----- Method: EventSensor class>>installMappingToCommandKeys (in category 'key decode table') -----
  installMappingToCommandKeys
  "Maps all keyboard events that arrive with the CONTROL modifier to also have the COMMAND modifier set. This mapping also considers the preference #mapControlCharactersToPrintableCharacters."
 
  | controlMask |
  0 "NUL" to: 27 "ESC" do: [:control |
  controlMask := self mapControlCharactersToPrintableCharacters
  ifTrue: [16r60] ifFalse: [0].
  KeyDecodeTable
  at: { control . 2r0010 "ctrl" }
  put: { control bitOr: controlMask . 2r1010 "cmd+ctrl" }.
  controlMask := self mapControlCharactersToPrintableCharacters
  ifTrue: [16r40] ifFalse: [0].
  KeyDecodeTable
  at: { control . 2r0011 "ctrl+shift" }
+ put: { control bitOr: controlMask . 2r1011 "cmd+ctrl+shift" }].
- put: { control bitOr: controlMask . 2r1011 "cmd+ctrl+shift" }].
 
  28 "arrow keys" to: 126 "$~" do: [:arrowAndPrintable |
  KeyDecodeTable
  at: { arrowAndPrintable . 2r0010 "ctrl" }
  put: { arrowAndPrintable . 2r1010 "cmd+ctrl" }.
  KeyDecodeTable
+ at: { arrowAndPrintable . 2r0011 "ctrl+shift" }
+ put: { arrowAndPrintable . 2r1011 "cmd+ctrl+shift" }].
+
+ self mapControlCharactersToPrintableCharacters ifFalse: [
+ "See #fixControlCharacters. #linuxOnly"
+ 64 "$@" to: 95 "$_"do: [:upper |
+ KeyDecodeTable
+ at: { upper . 2r0011 "ctrl+shift" }
+ put: { upper bitAnd: 16r9F . 2r1011 "cmd+ctrl+shift" }].
+ 96 "$`" to: 126 "$~" do: [:lower | "Ignore 127"
+ KeyDecodeTable
+ at: { lower . 2r0010 "ctrl" }
+ put: { lower bitAnd: 16r9F . 2r1010 "cmd+ctrl" }]].!
- at: { arrowAndPrintable . 2r0011 "ctrl + shift" }
- put: { arrowAndPrintable . 2r1011 "cmd + shift" }].!