Commit 740fdfd0 authored by dscho's avatar dscho

init keyboard now takes correct display

parent 8c70b301
...@@ -25,13 +25,11 @@ KeyCode keycodes[0x100],leftShiftCode,rightShiftCode,altGrCode; ...@@ -25,13 +25,11 @@ KeyCode keycodes[0x100],leftShiftCode,rightShiftCode,altGrCode;
void init_keycodes() void init_keycodes()
{ {
Display *dpy;
KeySym key,*keymap; KeySym key,*keymap;
int i,j,minkey,maxkey,syms_per_keycode; int i,j,minkey,maxkey,syms_per_keycode;
memset(modifiers,-1,sizeof(modifiers)); memset(modifiers,-1,sizeof(modifiers));
dpy=XOpenDisplay("");
XDisplayKeycodes(dpy,&minkey,&maxkey); XDisplayKeycodes(dpy,&minkey,&maxkey);
keymap=XGetKeyboardMapping(dpy,minkey,(maxkey - minkey + 1),&syms_per_keycode); keymap=XGetKeyboardMapping(dpy,minkey,(maxkey - minkey + 1),&syms_per_keycode);
...@@ -227,6 +225,7 @@ int main(int argc,char** argv) ...@@ -227,6 +225,7 @@ int main(int argc,char** argv)
for(i=argc-1;i>0;i--) for(i=argc-1;i>0;i--)
if(i<argc-1 && strcmp(argv[i],"-display")==0) { if(i<argc-1 && strcmp(argv[i],"-display")==0) {
fprintf(stderr,"Using display %s\n",argv[i+1]);
dpy = XOpenDisplay(argv[i+1]); dpy = XOpenDisplay(argv[i+1]);
if(dpy==0) { if(dpy==0) {
fprintf(stderr,"Couldn't connect to display \"%s\".\n",argv[i+1]); fprintf(stderr,"Couldn't connect to display \"%s\".\n",argv[i+1]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment