]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - keys.h
Fixed two keyboard bugs:
[xonotic/darkplaces.git] / keys.h
diff --git a/keys.h b/keys.h
index 57ec1702c909bf8cf1cbf50a61cb0c0436b3ee44..26c711d0838e17dfa9699afd391a2f59e4710aee 100644 (file)
--- a/keys.h
+++ b/keys.h
 #include "fs.h"
 #include "cmd.h"
 
+// the highest Unicode character to allow key binding.
+// note that an excessively high value may degrade fps
+// when code is looping through the bindings
+#define MAX_KEY_BINDS 0xfff0
+
+// how long is a "tinystr" to hold a keyboard key's
+// Unicode utf-8 presentation, plus final \x00
+// to allow all characters <= 0xffff, use 4
+#define TINYSTR_LEN 4
+
 //
 // these are the key numbers that should be passed to Key_Event
 //
@@ -353,7 +363,7 @@ typedef enum keynum_e
        K_MIDINOTE126,
        K_MIDINOTE127,
 
-       MAX_KEYS
+       MAX_KEYS = MAX_KEY_BINDS
 }
 keynum_t;