1
0
mirror of git://git.suckless.org/svkbd synced 2024-12-18 04:04:44 +00:00

code-style changes

This commit is contained in:
Hiltjo Posthuma 2021-03-28 15:02:25 +02:00
parent 8f6a7b5e42
commit 7c06a0caf5

17
svkbd.c
View File

@ -492,6 +492,7 @@ printkey(Key *k, KeySym mod)
printdbg("Printing key %ld (shift=%d)\n", k->keysym, shift);
if (k->keysym == XK_Cancel)
return;
KeySym *keysym = &(k->keysym);
XIM xim = XOpenIM(dpy, 0, 0, 0);
XIC xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, NULL);
@ -519,8 +520,12 @@ printkey(Key *k, KeySym mod)
void
simulate_keypress(KeySym keysym)
{
if (!simulateoutput) return;
KeyCode code = XKeysymToKeycode(dpy, keysym);
KeyCode code;
if (!simulateoutput)
return;
code = XKeysymToKeycode(dpy, keysym);
if (code == 0)
code = tmp_remap(keysym);
XTestFakeKeyEvent(dpy, code, True, 0);
@ -529,8 +534,12 @@ simulate_keypress(KeySym keysym)
void
simulate_keyrelease(KeySym keysym)
{
if (!simulateoutput) return;
KeyCode code = XKeysymToKeycode(dpy, keysym);
KeyCode code;
if (!simulateoutput)
return;
code = XKeysymToKeycode(dpy, keysym);
if (code == 0)
code = tmp_remap(keysym);
XTestFakeKeyEvent(dpy, code, False, 0);