1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-06 05:44:11 +01:00

WPrefs: XKeycodeToKeysym deprecated function

The function XKeycodeToKeysym is deprecated and should be replaced
by XkbKeycodeToKeysym.
This commit is contained in:
Rodolfo García Peñas (kix)
2012-07-15 10:54:44 +02:00
committed by Carlos R. Mafra
parent 139f912e61
commit 43c3526d21
3 changed files with 6 additions and 3 deletions

View File

@@ -25,6 +25,7 @@
#include <ctype.h> #include <ctype.h>
#include <X11/keysym.h> #include <X11/keysym.h>
#include <X11/XKBlib.h>
typedef struct _Panel { typedef struct _Panel {
WMBox *box; WMBox *box;
@@ -242,7 +243,7 @@ char *capture_shortcut(Display *dpy, Bool *capturing, Bool convert_case)
XAllowEvents(dpy, AsyncKeyboard, CurrentTime); XAllowEvents(dpy, AsyncKeyboard, CurrentTime);
WMNextEvent(dpy, &ev); WMNextEvent(dpy, &ev);
if (ev.type == KeyPress && ev.xkey.keycode != 0) { if (ev.type == KeyPress && ev.xkey.keycode != 0) {
ksym = XKeycodeToKeysym(dpy, ev.xkey.keycode, 0); ksym = XkbKeycodeToKeysym(dpy, ev.xkey.keycode, 0, 0);
if (!IsModifierKey(ksym)) { if (!IsModifierKey(ksym)) {
if (convert_case) { if (convert_case) {
XConvertCase(ksym, &lksym, &uksym); XConvertCase(ksym, &lksym, &uksym);

View File

@@ -23,6 +23,7 @@
#include "WPrefs.h" #include "WPrefs.h"
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/XKBlib.h>
#include <unistd.h> #include <unistd.h>
#include <math.h> #include <math.h>
@@ -361,7 +362,7 @@ static void fillModifierPopUp(WMPopUpButton * pop)
if (mapping->modifiermap[idx] != 0) { if (mapping->modifiermap[idx] != 0) {
int l; int l;
for (l = 0; l < 4; l++) { for (l = 0; l < 4; l++) {
ksym = XKeycodeToKeysym(dpy, mapping->modifiermap[idx], l); ksym = XkbKeycodeToKeysym(dpy, mapping->modifiermap[idx], 0, l);
if (ksym != NoSymbol) if (ksym != NoSymbol)
break; break;
} }

View File

@@ -35,6 +35,7 @@ Perpetrator: Sudish Joseph <sj@eng.mindspring.net>, Sept. 1997. */
#include <strings.h> #include <strings.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/keysym.h> #include <X11/keysym.h>
#include <X11/XKBlib.h>
#include <WINGs/WUtil.h> #include <WINGs/WUtil.h>
@@ -159,7 +160,7 @@ static void x_reset_modifier_mapping(Display * display)
for (column = 0; column < 4; column += 2) { for (column = 0; column < 4; column += 2) {
KeyCode code = x_modifier_keymap->modifiermap[modifier_index * mkpm KeyCode code = x_modifier_keymap->modifiermap[modifier_index * mkpm
+ modifier_key]; + modifier_key];
KeySym sym = (code ? XKeycodeToKeysym(display, code, column) : 0); KeySym sym = (code ? XkbKeycodeToKeysym(display, code, 0, column) : 0);
if (sym == last_sym) if (sym == last_sym)
continue; continue;
last_sym = sym; last_sym = sym;