diff options
author | hobbs <hobbs> | 2000-02-09 02:13:43 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2000-02-09 02:13:43 (GMT) |
commit | 059c15807f394adcfc695c32df5b50ce2c7e246a (patch) | |
tree | ff6a4c8b0268173d5f2e3e61b6a03e90baae0ea8 /generic/tkIntDecls.h | |
parent | acfa815d400ff9f351e628c2dd24089170b2bfe3 (diff) | |
download | tk-059c15807f394adcfc695c32df5b50ce2c7e246a.zip tk-059c15807f394adcfc695c32df5b50ce2c7e246a.tar.gz tk-059c15807f394adcfc695c32df5b50ce2c7e246a.tar.bz2 |
* generic/tk.decls:
* generic/tkBind.c:
* generic/tkInt.decls:
* generic/tkIntDecls.h:
* generic/tkStubInit.c:
* mac/tkMacKeyboard.c:
* unix/tkUnixKey.c:
* win/tkWinKey.c: Fix for keyboard handling of "dead" keys and
caps lock from Peter Spjuth.
Split functions into platform specific files:
Static functions GetKeySym(), SetKeycodeAndState() and InitKeymapInfo()
from tkBind.c moved into platform files tkWinKey.c tkUnixKey.c and
tkMacKeyboard.c. GetKeySym() and SetKeycodeAndState() renamed to
Tkp* and made public (as private functions) in tkInt.decls.
Step 2, fixes in tkWinKey.c
New static function: KeycodeToKeysym(), based on XKeycodeToKeysym()
but with different arguments, and a lot of improvements.
TkpGetString() changed to use KeycodeToKeysym() + other fixes.
TkpGetKeySym() changed to use KeycodeToKeysym() + other fixes.
InitKeymapInfo() changed to use KeycodeToKeysym().
TkpSetKeycodeAndState() rewritten, mostly by copying code from
XKeysymToKeycode().
XKeycodeToKeysym() rewritten. Preferably it should be removed.
EXPLANATION: The main problem is ToAscii() which has a lot of side
effects, and also that XKeycodeToKeysym() is not provided enough
input to do a proper job. The changes' main goal is to avoid
calling ToAscii() if not necessary, and to provide it with as
correct information as possible when called. Also some attempts
to clean up what ToAscii() did are done. See the code for details.
BUGS FIXED: Typing shifted (and AltGr) dead keys did not work.
Keyboard lock lamps did not work on Win98.
Events regarding AltGr-keys behaved badly.
Example: On a Swedish keyboard, $ is typed with AltGr-4.
That keyboard event would get the keysym '4' not 'dollar'.
Also, doing [event generete . <Key-dollar>] would send keysym '4'.
Translation to ascii in TkpGetString did not handle return and
tab correctly. I.e. [event generate . <Key-Return>] gave wrong %A
Diffstat (limited to 'generic/tkIntDecls.h')
-rw-r--r-- | generic/tkIntDecls.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 8666b6a..fabe813 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkIntDecls.h,v 1.8 1999/08/10 16:58:37 hobbs Exp $ + * RCS: @(#) $Id: tkIntDecls.h,v 1.9 2000/02/09 02:13:51 hobbs Exp $ */ #ifndef _TKINTDECLS @@ -506,6 +506,12 @@ EXTERN void TkpDrawHighlightBorder _ANSI_ARGS_((Tk_Window tkwin, /* 136 */ EXTERN void TkSetFocusWin _ANSI_ARGS_((TkWindow * winPtr, int force)); +/* 137 */ +EXTERN void TkpSetKeycodeAndState _ANSI_ARGS_((Tk_Window tkwin, + KeySym keySym, XEvent * eventPtr)); +/* 138 */ +EXTERN KeySym TkpGetKeySym _ANSI_ARGS_((TkDisplay * dispPtr, + XEvent * eventPtr)); typedef struct TkIntStubs { int magic; @@ -808,6 +814,8 @@ typedef struct TkIntStubs { #endif /* MAC_TCL */ void (*tkpDrawHighlightBorder) _ANSI_ARGS_((Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable)); /* 135 */ void (*tkSetFocusWin) _ANSI_ARGS_((TkWindow * winPtr, int force)); /* 136 */ + void (*tkpSetKeycodeAndState) _ANSI_ARGS_((Tk_Window tkwin, KeySym keySym, XEvent * eventPtr)); /* 137 */ + KeySym (*tkpGetKeySym) _ANSI_ARGS_((TkDisplay * dispPtr, XEvent * eventPtr)); /* 138 */ } TkIntStubs; #ifdef __cplusplus @@ -1448,6 +1456,14 @@ extern TkIntStubs *tkIntStubsPtr; #define TkSetFocusWin \ (tkIntStubsPtr->tkSetFocusWin) /* 136 */ #endif +#ifndef TkpSetKeycodeAndState +#define TkpSetKeycodeAndState \ + (tkIntStubsPtr->tkpSetKeycodeAndState) /* 137 */ +#endif +#ifndef TkpGetKeySym +#define TkpGetKeySym \ + (tkIntStubsPtr->tkpGetKeySym) /* 138 */ +#endif #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ |