a few more tweaks
This commit is contained in:
parent
73f0edf709
commit
0bd17df5ed
27
svkbd.c
27
svkbd.c
@ -37,13 +37,10 @@ enum { SchemeNorm, SchemePress, SchemeHighlight, SchemeLast };
|
|||||||
enum { NetWMWindowType, NetLast };
|
enum { NetWMWindowType, NetLast };
|
||||||
|
|
||||||
/* typedefs */
|
/* typedefs */
|
||||||
typedef unsigned int uint;
|
|
||||||
typedef unsigned long ulong;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *label;
|
char *label;
|
||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
uint width;
|
unsigned int width;
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
Bool pressed;
|
Bool pressed;
|
||||||
Bool highlighted;
|
Bool highlighted;
|
||||||
@ -51,7 +48,7 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
KeySym mod;
|
KeySym mod;
|
||||||
uint button;
|
unsigned int button;
|
||||||
} Buttonmod;
|
} Buttonmod;
|
||||||
|
|
||||||
/* function declarations */
|
/* function declarations */
|
||||||
@ -349,9 +346,8 @@ hasoverlay(KeySym keysym)
|
|||||||
void
|
void
|
||||||
leavenotify(XEvent *e)
|
leavenotify(XEvent *e)
|
||||||
{
|
{
|
||||||
if (currentoverlay != -1) {
|
if (currentoverlay != -1)
|
||||||
hideoverlay();
|
hideoverlay();
|
||||||
}
|
|
||||||
unpress(NULL, 0);
|
unpress(NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,7 +459,8 @@ unpress(Key *k, KeySym mod)
|
|||||||
enableoverlays = !enableoverlays;
|
enableoverlays = !enableoverlays;
|
||||||
break;
|
break;
|
||||||
case XK_Break:
|
case XK_Break:
|
||||||
running = False;
|
running = False;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -599,9 +596,9 @@ setup(void)
|
|||||||
XTextProperty str;
|
XTextProperty str;
|
||||||
XSizeHints *sizeh = NULL;
|
XSizeHints *sizeh = NULL;
|
||||||
XClassHint *ch;
|
XClassHint *ch;
|
||||||
|
XWMHints *wmh;
|
||||||
Atom atype = -1;
|
Atom atype = -1;
|
||||||
int i, j, sh, sw;
|
int i, j, sh, sw;
|
||||||
XWMHints *wmh;
|
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
XineramaScreenInfo *info = NULL;
|
XineramaScreenInfo *info = NULL;
|
||||||
@ -629,7 +626,7 @@ setup(void)
|
|||||||
|
|
||||||
/* find an unused keycode to use as a temporary keycode (derived from source:
|
/* find an unused keycode to use as a temporary keycode (derived from source:
|
||||||
https://stackoverflow.com/questions/44313966/c-xtest-emitting-key-presses-for-every-unicode-character) */
|
https://stackoverflow.com/questions/44313966/c-xtest-emitting-key-presses-for-every-unicode-character) */
|
||||||
KeySym *keysyms = NULL;
|
KeySym *keysyms;
|
||||||
int keysyms_per_keycode = 0;
|
int keysyms_per_keycode = 0;
|
||||||
int keycode_low, keycode_high;
|
int keycode_low, keycode_high;
|
||||||
Bool key_is_empty;
|
Bool key_is_empty;
|
||||||
@ -817,10 +814,10 @@ showoverlay(int idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = idx, j=0; i < OVERLAYS; i++, j++) {
|
for (i = idx, j=0; i < OVERLAYS; i++, j++) {
|
||||||
if (overlay[i].keysym == XK_Cancel) {
|
if (overlay[i].keysym == XK_Cancel)
|
||||||
break;
|
break;
|
||||||
}
|
while (keys[j].keysym == 0)
|
||||||
while (keys[j].keysym == 0) j++;
|
j++;
|
||||||
keys[j].label = overlay[i].label;
|
keys[j].label = overlay[i].label;
|
||||||
keys[j].keysym = overlay[i].keysym;
|
keys[j].keysym = overlay[i].keysym;
|
||||||
}
|
}
|
||||||
@ -835,7 +832,7 @@ showoverlay(int idx)
|
|||||||
void
|
void
|
||||||
hideoverlay(void)
|
hideoverlay(void)
|
||||||
{
|
{
|
||||||
if (debug) printdbg("Hiding overlay %d\n", currentoverlay);
|
if (debug) printdbg("Hiding overlay, overlay was #%d\n", currentoverlay);
|
||||||
currentoverlay = -1;
|
currentoverlay = -1;
|
||||||
overlaykeysym = 0;
|
overlaykeysym = 0;
|
||||||
currentlayer = -1;
|
currentlayer = -1;
|
||||||
@ -847,7 +844,7 @@ sigterm(int signo)
|
|||||||
{
|
{
|
||||||
running = False;
|
running = False;
|
||||||
sigtermd = True;
|
sigtermd = True;
|
||||||
if (debug) printdbg("Sigterm received\n");
|
if (debug) printdbg("SIGTERM received\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user