[squeak-dev] The Trunk: Kernel-mt.1290.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Dec 23 10:24:26 UTC 2019


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

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

Name: Kernel-mt.1290
Author: mt
Time: 23 December 2019, 11:24:23.728349 am
UUID: b2e649ef-ad9d-5040-b6b0-70b7e29e4085
Ancestors: Kernel-mt.1289

Do actually *duplicate* CTRL and CMD/ALT keys if that preference is enabled.

This means that such key-stroke events will always answer TRUE to both #controlKeyPressed and #commandKeyPressed. This solves various issues in client code. Now all paths that only check for #controlKeyPressed will match even if the duplication preference is enabled.

Note that for applications that do want to make use of CTRL and ALT/CMD in separate ways, the PREFERENCE "duplicate (all) ctrl and alt keys" has to be DISABLED. Those applications can easily check and inform the user.

Also note that key duplication means that there is no way to detect actual control keys. Disable that preference if you want to hit CTRL+C and, for example, access "Character enter" (ASCII 3) for that event's #keyCharacter.

Finally note that I will double-check effects in TextEditor asap.

=============== Diff against Kernel-mt.1289 ===============

Item was changed:
  ----- Method: EventSensor class>>installDuplicateKeyEntryFor: (in category 'key decode table') -----
  installDuplicateKeyEntryFor: aPrintableCharacter
  	"Updates the key-decode table, which maps between pairs of {character code . modifier code}. See the class comment for more information.
  	Note that the bitmask 16r9F removes the high bits, which subtracts 64 from the key code for (upper) $A to $Z and 96 for (lower) $a to $z. The VM sends non-printable control characters for [ctrl]+[A-Za-Z] in ASCII < 32, but the given character is expected to be ASCII >= 32 and thus printable. So we have to convert printable characters to control characters in this mapping table."
  
  	| upper lower |
  	upper := aPrintableCharacter asUppercase asInteger.
  	lower := aPrintableCharacter asLowercase asInteger.
  	
+ 	KeyDecodeTable at: { lower bitAnd: 16r9F . 2 "ctrl" } put: { lower . 2 bitOr: 8 "ctrl + cmd/alt" }.
+ 	KeyDecodeTable at: { upper bitAnd: 16r9F . 2 bitOr: 1 "ctrl + shift" } put: { upper . (2 bitOr: 8) bitOr: 1 "ctrl + cmd/alt + shift" }.
+ 	KeyDecodeTable at: { lower . 8 "cmd/alt" } put: { lower . 8 bitOr: 2 "cmd/alt + ctrl" }.
+ 	KeyDecodeTable at: { upper . 8 bitOr: 1 "cmd/alt + shift" } put: { upper . (8 bitOr: 2) bitOr: 1 "cmd/alt + ctrl + shift" }.
- 	KeyDecodeTable at: { lower bitAnd: 16r9F . 2 "ctrl" } put: { lower . 8 "cmd/alt" }.
- 	KeyDecodeTable at: { upper bitAnd: 16r9F . 2 bitOr: 1 "ctrl+shift" } put: { upper . 8 bitOr: 1 "cmd/alt+shift" }.
  
  	"For Unix/Linux VMs as of version 201911282316, no control characters will be sent from the VM. Avoid check for #platformName because the extra mapping will not affect others anyway."
  	self flag: #unixOnly.
+ 	KeyDecodeTable at: { lower . 2 "ctrl" } put: { lower . 2 bitOr: 8 "ctrl + cmd/alt" }.
+ 	KeyDecodeTable at: { upper . 2 bitOr: 1 "ctrl + shift" } put: { upper . (2 bitOr: 8) bitOr: 1 "ctrl + cmd/alt + shift" }.!
- 	KeyDecodeTable at: { lower . 2 "ctrl" } put: { lower . 8 "cmd/alt" }.
- 	KeyDecodeTable at: { upper . 2 bitOr: 1 "ctrl+shift" } put: { upper . 8 bitOr: 1 "cmd/alt+shift" }.!



More information about the Squeak-dev mailing list