summaryrefslogtreecommitdiffstats
path: root/win/tkWinKey.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinKey.c')
-rw-r--r--win/tkWinKey.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/win/tkWinKey.c b/win/tkWinKey.c
index 29f2ff0..f4eba89 100644
--- a/win/tkWinKey.c
+++ b/win/tkWinKey.c
@@ -99,6 +99,7 @@ TkpGetString(
XKeyEvent *keyEv = &eventPtr->xkey;
int len;
char buf[4];
+ (void)winPtr;
Tcl_DStringInit(dsPtr);
if (keyEv->send_event == -1) {
@@ -155,6 +156,24 @@ XKeycodeToKeysym(
int index)
{
int state = 0;
+ (void)display;
+
+ if (index & 0x01) {
+ state |= ShiftMask;
+ }
+ return KeycodeToKeysym(keycode, state, 0);
+}
+
+KeySym
+XkbKeycodeToKeysym(
+ Display *display,
+ unsigned int keycode,
+ int group,
+ int index)
+{
+ int state = 0;
+ (void)display;
+ (void)group;
if (index & 0x01) {
state |= ShiftMask;
@@ -504,7 +523,7 @@ TkpInitKeymapInfo(
}
dispPtr->numModKeyCodes = 0;
arraySize = KEYCODE_ARRAY_SIZE;
- dispPtr->modKeyCodes = ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode));
+ dispPtr->modKeyCodes = (KeyCode *)ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode));
for (i = 0, codePtr = modMapPtr->modifiermap; i < max; i++, codePtr++) {
if (*codePtr == 0) {
continue;
@@ -520,18 +539,18 @@ TkpInitKeymapInfo(
}
}
if (dispPtr->numModKeyCodes >= arraySize) {
- KeyCode *new;
+ KeyCode *newKey;
/*
* Ran out of space in the array; grow it.
*/
arraySize *= 2;
- new = ckalloc(arraySize * sizeof(KeyCode));
- memcpy(new, dispPtr->modKeyCodes,
+ newKey = (KeyCode *)ckalloc(arraySize * sizeof(KeyCode));
+ memcpy(newKey, dispPtr->modKeyCodes,
dispPtr->numModKeyCodes * sizeof(KeyCode));
ckfree(dispPtr->modKeyCodes);
- dispPtr->modKeyCodes = new;
+ dispPtr->modKeyCodes = newKey;
}
dispPtr->modKeyCodes[dispPtr->numModKeyCodes] = *codePtr;
dispPtr->numModKeyCodes++;
@@ -542,7 +561,7 @@ TkpInitKeymapInfo(
/*
* When mapping from a keysym to a keycode, need information about the
- * modifier state that should be used so that when they call XKeycodeToKeysym
+ * modifier state that should be used so that when they call XkbKeycodeToKeysym
* taking into account the xkey.state, they will get back the original keysym.
*/
@@ -555,6 +574,7 @@ TkpSetKeycodeAndState(
int i;
SHORT result;
int shift;
+ (void)tkwin;
eventPtr->xkey.keycode = 0;
if (keySym == NoSymbol) {
@@ -611,6 +631,7 @@ XKeysymToKeycode(
{
int i;
SHORT result;
+ (void)display;
/*
* We check our private map first for a virtual keycode, as VkKeyScan will
@@ -656,10 +677,11 @@ XModifierKeymap *
XGetModifierMapping(
Display *display)
{
- XModifierKeymap *map = ckalloc(sizeof(XModifierKeymap));
+ XModifierKeymap *map = (XModifierKeymap *)ckalloc(sizeof(XModifierKeymap));
+ (void)display;
map->max_keypermod = 1;
- map->modifiermap = ckalloc(sizeof(KeyCode) * 8);
+ map->modifiermap = (KeyCode *)ckalloc(sizeof(KeyCode) * 8);
map->modifiermap[ShiftMapIndex] = VK_SHIFT;
map->modifiermap[LockMapIndex] = VK_CAPITAL;
map->modifiermap[ControlMapIndex] = VK_CONTROL;
@@ -717,6 +739,8 @@ KeySym
XStringToKeysym(
_Xconst char *string)
{
+ (void)string;
+
return NoSymbol;
}
@@ -740,6 +764,8 @@ char *
XKeysymToString(
KeySym keysym)
{
+ (void)keysym;
+
return NULL;
}