From 33c1099799c6d489e849742b5d9fb7f7f6a06c3c Mon Sep 17 00:00:00 2001 From: tobigun Date: Thu, 23 Jul 2009 15:05:49 +0000 Subject: CTRL+[A-Z] experiment git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1864 b956fd51-792f-4845-bead-9b4dfca2ff2c --- unicode/src/base/UMain.pas | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'unicode/src/base') diff --git a/unicode/src/base/UMain.pas b/unicode/src/base/UMain.pas index 1962e953..0c3410d1 100644 --- a/unicode/src/base/UMain.pas +++ b/unicode/src/base/UMain.pas @@ -468,6 +468,16 @@ begin end; SDL_KEYDOWN: begin + // translate CTRL-A (ASCII 1) - CTRL-Z (ASCII 26) to correct charcodes. + // keysyms (SDLK_A, ...) could be used instead but they ignore the + // current key mapping (if 'a' is pressed on a French keyboard the + // .unicode field will be 'a' and .sym SDLK_Q). + // IMPORTANT: if CTRL is pressed with a key different than 'A'-'Z' SDL + // will set .unicode to 0. There is no possibility to obtain a + // translated charcode. Use keysyms instead. + //if (Event.key.keysym.unicode in [1 .. 26]) then + // Event.key.keysym.unicode := Ord('A') + Event.key.keysym.unicode - 1; + // remap the "keypad enter" key to the "standard enter" key if (Event.key.keysym.sym = SDLK_KP_ENTER) then Event.key.keysym.sym := SDLK_RETURN; -- cgit v1.2.3