--
 [][][] Tony Garnock-Jones     | Mob: +44 (0)7905 974 211
   [][] LShift Ltd             | Tel: +44 (0)20 7729 7060
 []  [] http://www.lshift.net/ | Email: [EMAIL PROTECTED]
>From d6f5d6ac72221aaf944d315749abd2ed593ab3a6 Mon Sep 17 00:00:00 2001
From: Tony Garnock-Jones <[EMAIL PROTECTED]>
Date: Tue, 1 Jul 2008 09:57:25 +0100
Subject: [PATCH] SDL's keysyms are chosen to map to ASCII when possible. Some codes are
 greater than 127, though; those shouldn't be converted to Character
 instances. Instead, they should be compared to the results of methods
 like "SdlKeySym sdlkLshift".

---
 packages/sdl/libsdl/EventSource.st |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/packages/sdl/libsdl/EventSource.st b/packages/sdl/libsdl/EventSource.st
index 572ec25..1e9a055 100644
--- a/packages/sdl/libsdl/EventSource.st
+++ b/packages/sdl/libsdl/EventSource.st
@@ -218,12 +218,20 @@ SdlKeyBoardEvent extend [
 	^ r
     ]
 
+    keySym [
+	| s |
+	s := self sym value.
+	^ (s > 127)
+	    ifTrue: [s]
+	    ifFalse: [Character value: s]
+    ]
+
     dispatchTo: handler [
 	<category: 'dispatch'>
 	handler handleKey: self which value asInteger
 		state: self state value asInteger ~= 0
 		scanCode: self scanCode value asInteger
-		sym: (Character value: self sym value)
+		sym: self keySym
 		mod: self keyboardModifiers
 		unicode: (Character codePoint: self unicode value)
     ]
-- 
1.5.3.5

_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to