JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Checking for the lower X11 special keys too. Thanks Benjamin R. Haskell!
[st.git] / st.c
diff --git a/st.c b/st.c
index fc64a77..433f7b4 100644 (file)
--- a/st.c
+++ b/st.c
@@ -2431,9 +2431,13 @@ xinit(void) {
 
        /* input methods */
        xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL);
+       if(xw.xim == NULL)
+               die("XOpenIM failed. Could not open input device.\n");
        xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing
                                           | XIMStatusNothing, XNClientWindow, xw.win,
                                           XNFocusWindow, xw.win, NULL);
+       if(xw.xic == NULL)
+               die("XCreateIC failed. Could not obtain input method.\n");
 
        /* white cursor, black outline */
        cursor = XCreateFontCursor(xw.dpy, XC_xterm);
@@ -2724,7 +2728,7 @@ kmap(KeySym k, uint state) {
                        break;
        }
        if(i == LEN(mappedkeys)) {
-               if((k & 0xFFFF) < 0xFF00)
+               if((k & 0xFFFF) < 0xFD00)
                        return NULL;
        }
 
@@ -2742,12 +2746,13 @@ kmap(KeySym k, uint state) {
                                continue;
                        if(term.numlock && kp->appkey == 2)
                                continue;
-               } else if (kp->appkey < 0 && IS_SET(MODE_APPKEYPAD)) {
+               } else if(kp->appkey < 0 && IS_SET(MODE_APPKEYPAD)) {
                        continue;
                }
 
                if((kp->appcursor < 0 && IS_SET(MODE_APPCURSOR)) ||
-                               (kp->appcursor > 0 && !IS_SET(MODE_APPCURSOR))) {
+                               (kp->appcursor > 0
+                                && !IS_SET(MODE_APPCURSOR))) {
                        continue;
                }