[Bug][Fix] Setting copy/paste-key preference under Windows does not
work
Hannes Hirzel
hirzel at spw.unizh.ch
Mon Dec 6 09:52:12 UTC 2004
Hannes Hirzel wrote:
> In the thread - "A Word of Caution" to all newcomers - Andreas Raab
> suggested to set the preferences under Windows by default so that the
> copy/paste keyboard shortcuts work the way people expect them to be.
ctrl x = cut
ctrl c = copy
ctrl v = paste
ctrl a = select all
The attached change set fixes this problem. It only changes one method
adding one line and replacing #true by true in the last line as they are
not the same objects.
Note: The fix is important for all platforms as one error prevented the
method having its desired effect.
Class: SmalltalkImage
Method:
setPlatformPreferences
"Set some platform specific preferences on system startup"
| platform specs |
Preferences automaticPlatformSettings ifFalse:[^self].
platform _ self platformName.
specs _ #(
(soundStopWhenDone false)
(soundQuickStart false)
).
platform = 'Win32' ifTrue:[
specs _ #(
(soundStopWhenDone true)
(soundQuickStart false)
(swapControlAndAltKeys true)
)].
platform = 'Mac OS' ifTrue:[
specs _ #(
(soundStopWhenDone false)
(soundQuickStart true)
)].
specs do:[:tuple|
Preferences setPreference: tuple first toValue: (tuple
last == true).
].
This was tested with Squeak3.8gamma-6497 (the Squeak 3.8gamma version of
today). I propose to include this in the gamma version.
Hannes
-------------- next part --------------
'From Squeak3.8gamma of ''24 November 2004'' [latest update: #6497] on 6 December 2004 at 9:35:57 am'!
"Change Set: setPlatformPreferences
Date: 6 December 2004
Author: Hannes Hirzel
This fixes the method SmalltalkImage>>setPlatformPreferences as it did not work at all.
true is not the same object as #true.
At the same time the preference swapControlAndAltKeys is set for Windows so that the cut/copy/paste/select-all keyboard shortcuts are the ones people expect.
"!
!SmalltalkImage methodsFor: 'preferences' stamp: 'HJH 12/6/2004 09:29'!
setPlatformPreferences
"Set some platform specific preferences on system startup"
| platform specs |
Preferences automaticPlatformSettings ifFalse:[^self].
platform _ self platformName.
specs _ #(
(soundStopWhenDone false)
(soundQuickStart false)
).
platform = 'Win32' ifTrue:[
specs _ #(
(soundStopWhenDone true)
(soundQuickStart false)
(swapControlAndAltKeys true)
)].
platform = 'Mac OS' ifTrue:[
specs _ #(
(soundStopWhenDone false)
(soundQuickStart true)
)].
specs do:[:tuple|
Preferences setPreference: tuple first toValue: (tuple last == true).
].! !
More information about the Squeak-dev
mailing list
|