I've just noticed this (the localisation stuff may have some kind of bearing on it, but......).
There I was trying to put a name with "ü" (that's u with a dieresis, I think) in my Rolodex. Of course, you can copy and paste into a workspace and it'll appear correctly, but you can't copy and paste into a Text or ShowEmptyText morph (maybe I should take a look at that -- I think it would be useful). But is there any way (and here I'm working in Linux -- I guess the old number pad method works in Windows) of typing it in directly, given a UK keyboard? (Here, locales or foreign keyboards are not really a viable option: I'd need some bizzare combination of Italian, German and Spanish.
Cheers
John
Hi John,
I don't think you're right with your observation that locale's aren't an option in your case. Most non US/UK-keyboards are somewhat internationalized in a way that you can access Characters from foreign countries with little effort. The simplest way to do this is the "DeadCharacters" support. Now this can be rather annoying because you have to type $^ $ to make the caret appear because the caret is a dead Character and the logic cannot decide wheater it will be combined to a %eacute; or not before the next key is pressed. The other solution I saw was the Sun-keyboards wich use a dedicated combine-key. Once this key is pressed the next two characters will be combined to one within the possibilities of the codepage used. This on the other hand will take three keystrokes instead of two for every character that is not on the keyboard, and that can be very annoying too.
No matter, I implemented a very simple but effective "DeadCharacter" suport for squeak based on 2.8alpha-1789 - I hope it wont break to many things when filed in. Feel free to modify the code or the bindings as you pleases.
John Hinsley wrote:
I've just noticed this (the localisation stuff may have some kind of bearing on it, but......).
There I was trying to put a name with "ü" (that's u with a dieresis, I think) in my Rolodex. Of course, you can copy and paste into a workspace and it'll appear correctly, but you can't copy and paste into a Text or ShowEmptyText morph (maybe I should take a look at that -- I think it would be useful). But is there any way (and here I'm working in Linux -- I guess the old number pad method works in Windows) of typing it in directly, given a UK keyboard? (Here, locales or foreign keyboards are not really a viable option: I'd need some bizzare combination of Italian, German and Spanish.
Cheers
John
-- Can't cope anymore? Desperate for help? Join the 12 step program for those who yearn to give up Microsoft: http://home.earthlink.net/~penguinrox/index.html
P.S.: I think the french keyboard is the best starting point. they already have most of the characters there and the diaresis is a separate key so you can combine all the umlauts and tremata.
'From Squeak2.7 of 5 January 2000 [latest update: #1789] on 30 September 2001 at 11:57:46 pm'! "Change Set: DeadCharacterSupport-th Date: 30 September 2001 Author: Your Name
Adds dead character support in ParagraphEditors and their heirs.
ToDo: 1 - make it a preference. 2 - think of ways to produce the remainig characters as well 3 - maybe switch to compose-key logic 4 - general cleanup of code
Dead characters are a relatively straightforward way to type in Characters that are not directly available on the keyboard. This approach is being used by several Keyboard-drivers. In this simplistic approach there is plenty of room for improvement. Here is a list of characters that i have not been able to map to the given dead/character/character combinations. If you find a way to map them, go on. '$§ $® $¯ $¾ $¿ $Î $Ï ' A more thorough approach would surely make use of a combine-key (cf Sun-keyboards)"!
Magnitude subclass: #Character instanceVariableNames: 'value ' classVariableNames: 'CharacterTable DeadCharacters ' poolDictionaries: '' category: 'Collections-Text'! ScrollController subclass: #ParagraphEditor instanceVariableNames: 'paragraph startBlock stopBlock beginTypeInBlock emphasisHere initialText selectionShowing otherInterval lastDeadCharacter ' classVariableNames: 'ChangeText CmdActions CurrentSelection FindText Keyboard ShiftCmdActions TextEditorYellowButtonMenu TextEditorYellowButtonMessages UndoInterval UndoMessage UndoParagraph UndoSelection Undone ' poolDictionaries: 'TextConstants ' category: 'Kernel-ST80 Remnants'!
!Character methodsFor: 'converting' stamp: 'th 9/30/2001 22:20'! combineWith: aCharacter "Dead Character support" self isDeadCharacter ifFalse:[^ String with: self with: aCharacter]. ^(self class deadCharacters at: self) at: aCharacter ifAbsent: [String with: self with: aCharacter]! !
!Character methodsFor: 'converting' stamp: 'th 9/30/2001 22:22'! isDeadCharacter ^ self class deadCharacters includesKey: self! !
!Character class methodsFor: 'constants' stamp: 'th 9/30/2001 23:36'! deadCharacters "Dead characters are a relatively straightforward way to type in Characters that are not directly available on the keyboard. This approach is being used by several Keyboard-drivers." "In this simplistic approach there is plenty room for improvement. For a beginning you might want to implement this as a class variable so it wont get re-built from scratch on each invocation." "second: here is a list of characters that i have not been able to map to the given dead/character/character combinations. If you find a way to map them, go on." "$§ $® $¯ $¾ $¿ $Î $Ï " "A more thorough approach would surely make use of a combine-key (cf Sun-keyboards)" ^DeadCharacters ifNotNil:[DeadCharacters] ifNil: [DeadCharacters _ Dictionary newFrom: { $~ -> (Dictionary newFrom:{$n -> '-'. $A ->'Ì'. $O -> 'Í'. $N -> '?'. $a -> '<'. $o -> '>' }). $^ -> (Dictionary newFrom:{$a -> '?'. $e -> '?'. $i -> '?'. $o -> '?'. $u -> '?' }). $¡ -> (Dictionary newFrom:{$A -> '?'. $a -> '?' }). $« -> (Dictionary newFrom:{$a -> '?'. $C -> ','. $E -> 'f'. $c -> '?'. $e -> '?'. $i -> '?'. $o -> '-'. $u -> '?' }). $` -> (Dictionary newFrom:{$A -> 'Ë'. $a -> '^'. $e -> '?'. $i -> '?'. $o -> '~'. $u -> '?' }). $¬ -> (Dictionary newFrom:{$a -> 'S'. $A -> '?'. $O -> '?'. $U -> '?'. $e -> '?'. $i -> '*'. $o -> 's'. $u -> 'Y'. $y -> 'Ø' }) }]! !
!ParagraphEditor methodsFor: 'typing/selecting keys' stamp: 'th 9/30/2001 23:40'! normalCharacter: t1 | nextChar | nextChar _ sensor keyboard. lastDeadCharacter isNil ifTrue:[nextChar isDeadCharacter ifTrue:[lastDeadCharacter _ nextChar] ifFalse:[t1 nextPut: nextChar]] ifFalse:[ t1 nextPutAll: (lastDeadCharacter combineWith: nextChar). lastDeadCharacter _ nil]. "t1 nextPut: sensor keyboard." ^ false! !
Torge Husfeldt wrote:
Hi John,
//snipped//
No matter, I implemented a very simple but effective "DeadCharacter" suport for squeak based on 2.8alpha-1789 - I hope it wont break to many things when filed in. Feel free to modify the code or the bindings as you pleases.
Thanks Torge:
I'm not absolutely sure what I'm supposed to type: the file in went without a hitch -- at least, it doesn't seem to have broken anything (but maybe something broke it? ;-) ). -- An admission, I never get on well with keyboard modifiers: the only ones I seem to be able to use are in gvim and a rather nice word processor on the Atari. (Neither of which are a great deal of use here!) Treat me as very stupid in this respect!
I open up a Workspace, and run a "print it" on Characters deadCharacters and get:
a Dictionary($^->a Dictionary($a->'?' $e->'?' $i->'?' $o->'?' $u->'?' ) $`->a Dictionary($A->'À' $a->'^' $e->'?' $i->'?' $o->'~' $u->'?' ) $~->a Dictionary($A->'Ã' $N->'?' $O->'Õ' $a->'<' $n->'-' $o->'>' ) $°->a Dictionary($A->'?' $a->'?' ) $´->a Dictionary($C->',' $E->'f' $a->'?' $c->'?' $e->'?' $i->'?' $o->'-' $u->'?' ) $¨->a Dictionary($A->'?' $O->'?' $U->'?' $a->'S' $e->'?' $i->'*' $o->'s' $u->'Y' $y->'ÿ' ) )
I do a series of print its:
$ isDeadCharacter false Nothing more expected ->~ isDeadCharacter # isDeadCharacter #isDeadCharacter Nothing more expected ->@ isDeadCharacter Unmatched string quote ->' isDeadCharacter | isDeadCharacter Vertical bar expected -> Nothing more expected ->? isDeadCharacter $^ isDeadCharacter true ^ isDeadCharacter nil
(this in the belief that US keyboards have the $ in a different place to UK ones -- but for the life of me, I can't remember where!)
Hmmm:
Nothing more expected ->£ isDeadCharacter
(Ah well, worth a try!)
I simply don't get it!
(This has always seemed to me to be one of the biggest holes in Linux: we have menus in languages from Hungarian through to simplified Chinese, but no easy way of getting even the simplest foreign character! Aaargh!)
Cheers
John
Hi Torge
I think I've begun to get my head around it (a little). So far:
The first two dictionaries work fine: À ^ ? ? ~ ? Ã ? Õ < - > //this keyboard has no superscript o (ascii 248) // Then we run into trouble. None of the other ones work. (Are we dealing here with -- it's difficult to see, even if I increase the text size 044 or 039 and is the last one 034?)
I've no other idea why! I'm also unsure of how this works. For example, in my niaivity I'd thought that I could change Character deadCharacter, accept it, and anything I'd coded in would work. Seems I need to do something else like re-initilize something. But what?
Cheers
John
Note that the original builtin fonts may not actually have the characters you're inputting, so if you don't see to be getting anything, that may be why. Squeak doesn't appear to have a "missing character" glyph.
-- Duane
Hi John,
You would have been well off with:
Character deadCharacters keys Set ($~ $´ $¨ $^ $` $° ) Character deadCharacters keys collect:[:each | each asciiValue] Set (126 171 172 94 96 161 )
Change the 172 to " if you can stand the pain of not seeing your quotes when you type 'em , but just when you type the next character.
John Hinsley wrote:
Hi Torge
I think I've begun to get my head around it (a little). So far:
The first two dictionaries work fine: À ^ ? ? ~ ? Ã ? Õ < - > //this keyboard has no superscript o (ascii 248) // Then we run into trouble. None of the other ones work. (Are we dealing here with -- it's difficult to see, even if I increase the text size 044 or 039 and is the last one 034?)
I've no other idea why! I'm also unsure of how this works. For example, in my niaivity I'd thought that I could change Character deadCharacter, accept it, and anything I'd coded in would work. Seems I need to do something else like re-initilize something. But what?
Remember for changes to take effect use DeadCharacters _ nil "doIt within CharacaterClass" or: Character initializeDeadCharacters "with V3 loaded" Old issue of out of date comments
Cheers
John
Can't cope anymore? Desperate for help? Join the 12 step program for those who yearn to give up Microsoft: http://home.earthlink.net/~penguinrox/index.html
Cheers, Torge P.S.: Use any character you don't type in too often on its own to modify the folowing one (just make sure you remember all your bindings - otherwise you could just do Characater allCharacters printIt, format it nicely and copy and past anytime you need a character not on your keyboard). P.P.S: If you have the possibility to do so, I _strongly_ recommend to use some non US/UK keyboard (like french, german, spanish, italian ...) because they already have some non-trivial subset of the characters you might need on them.
DeadCharacters V3 from preamble: "Change Set: DeadCharacterSupport-th Date: 30 September 2001 Author: Your Name
Adds dead character support in ParagraphEditors and their heirs. Just open up some TextEditor wich inherits from ParagraphEditor and type in: ^e you will hopefully get: ê Look into Character >> deadCharacters for more bindings (a bit cryptic but always up to date). To Undo revert ParagraphEditor>> normalCharacter to its former state (or flame jean-jacques.gelee@gmx.de).
Versions: 3: got some comment right, eat spaces, more explanation, added initializer. 2: initial release ToDo: 1 - make it a preference. 2 - think of ways to produce the remainig characters as well 3 - maybe switch to compose-key logic 4 - general cleanup of code
Dead characters are a relatively straightforward way to type in Characters that are not directly available on the keyboard. This approach is being used by several Keyboard-drivers. In this simplistic approach there is plenty of room for improvement. Here is a list of characters that i have not been able to map to the given dead/character/character combinations. If you find a way to map them, go on. '$ß $Æ $Ø $æ $ø $? $? ' A more thorough approach would surely make use of a combine-key (cf Sun-keyboards)"
'From Squeak2.7 of 5 January 2000 [latest update: #1789] on 1 October 2001 at 10:38:16 am'! "Change Set: DeadCharacterSupport-th Date: 30 September 2001 Author: Your Name
Adds dead character support in ParagraphEditors and their heirs. Just open up some TextEditor wich inherits from ParagraphEditor and type in: ^e you will hopefully get: ? Look into Character >> deadCharacters for more bindings (a bit cryptic but always up to date). To Undo revert ParagraphEditor>> normalCharacter to its former state (or flame jean-jacques.gelee@gmx.de).
Versions: 3: got some comment right, eat spaces, more explanation, added initializer. 2: initial release ToDo: 1 - make it a preference. 2 - think of ways to produce the remainig characters as well 3 - maybe switch to compose-key logic 4 - general cleanup of code
Dead characters are a relatively straightforward way to type in Characters that are not directly available on the keyboard. This approach is being used by several Keyboard-drivers. In this simplistic approach there is plenty of room for improvement. Here is a list of characters that i have not been able to map to the given dead/character/character combinations. If you find a way to map them, go on. '$§ $® $¯ $¾ $¿ $Î $Ï ' A more thorough approach would surely make use of a combine-key (cf Sun-keyboards)"!
Magnitude subclass: #Character instanceVariableNames: 'value ' classVariableNames: 'CharacterTable DeadCharacters ' poolDictionaries: '' category: 'Collections-Text'! ScrollController subclass: #ParagraphEditor instanceVariableNames: 'paragraph startBlock stopBlock beginTypeInBlock emphasisHere initialText selectionShowing otherInterval lastDeadCharacter ' classVariableNames: 'ChangeText CmdActions CurrentSelection FindText Keyboard ShiftCmdActions TextEditorYellowButtonMenu TextEditorYellowButtonMessages UndoInterval UndoMessage UndoParagraph UndoSelection Undone ' poolDictionaries: 'TextConstants ' category: 'Kernel-ST80 Remnants'!
!Character methodsFor: 'converting' stamp: 'th 9/30/2001 22:20'! combineWith: aCharacter "Dead Character support" self isDeadCharacter ifFalse:[^ String with: self with: aCharacter]. ^(self class deadCharacters at: self) at: aCharacter ifAbsent: [String with: self with: aCharacter]! !
!Character methodsFor: 'converting' stamp: 'th 9/30/2001 22:22'! isDeadCharacter ^ self class deadCharacters includesKey: self! !
!Character class methodsFor: 'constants' stamp: 'th 10/1/2001 10:27'! deadCharacters "Dead characters are a relatively straightforward way to type in Characters that are not directly available on the keyboard. This approach is being used by several Keyboard-drivers." "In this simplistic approach there is plenty room for improvement." "Here is a list of characters that i have not been able to map to the given dead/character/character combinations. If you find a way to map them, go on." "$§ $® $¯ $¾ $¿ $Î $Ï $À $Á" "A more thorough approach would surely make use of a combine-key (cf Sun-keyboards)" ^DeadCharacters ifNotNil:[DeadCharacters] ifNil: [DeadCharacters _ Dictionary newFrom: { $~ -> (Dictionary newFrom:{$n -> '-'. $A ->'Ì'. $O -> 'Í'. $N -> '?'. $a -> '<'. $o -> '>'. $ -> '~' }). $^ -> (Dictionary newFrom:{$a -> '?'. $e -> '?'. $i -> '?'. $o -> '?'. $u -> '?'. $ -> '^' }). $¡ -> (Dictionary newFrom:{$A -> '?'. $a -> '?'. $ -> '¡' }). $« -> (Dictionary newFrom:{$a -> '?'. $C -> ','. $E -> 'f'. $c -> '?'. $e -> '?'. $i -> '?'. $o -> '-'. $u -> '?'. $? -> 'À'. $!! -> 'Á'. $ -> '«'}). $` -> (Dictionary newFrom:{$A -> 'Ë'. $a -> '^'. $e -> '?'. $i -> '?'. $o -> '~'. $u -> '?'. $ -> '`'}). $¬ -> (Dictionary newFrom:{$a -> 'S'. $A -> '?'. $O -> '?'. $U -> '?'. $e -> '?'. $i -> '*'. $o -> 's'. $u -> 'Y'. $y -> 'Ø'. $ -> '¬' }) }]! !
!Character class methodsFor: 'constants' stamp: 'th 10/1/2001 10:27'! initializeDeadCharacters DeadCharacters _ nil! !
!ParagraphEditor methodsFor: 'typing/selecting keys' stamp: 'th 9/30/2001 23:40'! normalCharacter: t1 | nextChar | nextChar _ sensor keyboard. lastDeadCharacter isNil ifTrue:[nextChar isDeadCharacter ifTrue:[lastDeadCharacter _ nextChar] ifFalse:[t1 nextPut: nextChar]] ifFalse:[ t1 nextPutAll: (lastDeadCharacter combineWith: nextChar). lastDeadCharacter _ nil]. "t1 nextPut: sensor keyboard." ^ false! !
"Postscript: Make sure changes take effect if another version of DeadCharacterSupport is already loaded and Character class variable DeadCharacters is already initialized." Character initializeDeadCharacters !
squeak-dev@lists.squeakfoundation.org