Commit Graph

126 Commits

Author SHA1 Message Date
Paul LeoNerd Evans
97a47e9b16 Make common static function getkey(), roll functionallity of termkey_getkey{,_force}() into it 2008-12-05 23:55:44 +00:00
Paul LeoNerd Evans
2fba93b690 Added termkey_keyname2sym() to API 2008-12-02 00:56:43 +00:00
Paul LeoNerd Evans
f75bdf1516 Added termkey_get_fd() to API 2008-12-01 22:36:14 +00:00
Paul LeoNerd Evans
85be2846c3 Make sure l is always initialised in termkey_snprint_key() 2008-11-24 22:05:06 +00:00
Paul LeoNerd Evans
c8011f4bfd Make termkey_new_full() static for now until we expose the API fully 2008-11-24 22:03:23 +00:00
Paul LeoNerd Evans
f3f4519561 Fixed some signed/unsigned integer mismatches, including one important bug 2008-11-24 21:58:55 +00:00
Paul LeoNerd Evans
4f73b850c5 Added compile-vs-runtime library version checks 2008-11-16 12:40:14 +00:00
Paul LeoNerd Evans
397a7fb683 Added (undocumented) termkey_{get,set}_flags() calls to API 2008-11-10 21:21:19 +00:00
Paul LeoNerd Evans
20cc4b1701 When debugging, also print details of a key event when applicable 2008-11-09 21:58:30 +00:00
Paul LeoNerd Evans
fd2466c4ce Load terminfo triver before CSI; in case they both apply 2008-11-09 20:04:14 +00:00
Paul LeoNerd Evans
73cee7f0b0 Allow stacking drivers in a linked list; try all of them at getkey() time 2008-11-09 19:58:11 +00:00
Paul LeoNerd Evans
aef2e91277 If debugging, print verbose output about internals of getkey operation 2008-11-09 19:48:06 +00:00
Paul LeoNerd Evans
09edf2377f Driver getkey() can return TERMKEY_RES_NONE which attempts getkey_simple() afterwards 2008-11-09 19:45:43 +00:00
Paul LeoNerd Evans
de74ffa67f getkey_simple() should return TERMKEY_RES_NONE if no bytes available; as a safety check 2008-11-09 19:29:30 +00:00
Paul LeoNerd Evans
0483eacb68 Print name of driver on startup if debugging 2008-11-08 17:56:57 +00:00
Paul LeoNerd Evans
e880602944 Pass driver_info as explicit void* parameter into driver methods 2008-11-08 17:47:57 +00:00
Paul LeoNerd Evans
9cd46fcea3 Renamed termkey_{set,get}waittime() to termkey_{set,get}_waittime() to be more consistent 2008-11-06 20:29:50 +00:00
Paul LeoNerd Evans
a2f3d807f8 Better handling of incomplete UTF-8 sequences - just emit a UTF8_INVALID if waittime is up 2008-11-03 21:10:14 +00:00
Paul LeoNerd Evans
76147e92d4 Better handling in termkey_waitkey() of EOF conditions 2008-11-03 21:08:34 +00:00
Paul LeoNerd Evans
ca485ca670 Bugfix to recursive 'meta-' getkey code - handle buffcount too 2008-11-03 14:45:59 +00:00
Paul LeoNerd Evans
5107112a91 Added new driver virtual methods 'start_driver' and 'stop_driver' 2008-11-02 17:54:24 +00:00
Paul LeoNerd Evans
1d4d908cb8 Remeber to handle Esc-prefixed keypresses in base getkey_simple() function - involves some code duplication with CSI driver currently 2008-11-02 14:54:33 +00:00
Paul LeoNerd Evans
62d4e7eccb Pass the 'force' value through to getkey_simple() 2008-11-02 14:43:19 +00:00
Paul LeoNerd Evans
bb00cd64b1 Added many more key symbols and names + translations from terminfo 2008-10-10 01:11:24 +01:00
Paul LeoNerd Evans
fd769d621e 'int' might not be wide enough to hold any Unicode codepoint; use 'long' 2008-10-10 00:50:56 +01:00
Paul LeoNerd Evans
37156ad580 Added some TODO notes about handling realloc() failures 2008-10-09 23:53:35 +01:00
Paul LeoNerd Evans
2b08f88f19 Better free() tracking in constructor failure cases 2008-10-09 23:19:10 +01:00
Paul LeoNerd Evans
05639c4773 Pass 'term' string into new_driver virtual method; have drivers sensitive to it and return NULL if they can't handle. Try CSI driver first; only for xterm-alikes 2008-10-09 20:23:45 +01:00
Paul LeoNerd Evans
c974e61a8d Added initial attempt at a terminfo-driven driver 2008-10-08 02:04:47 +01:00
Paul LeoNerd Evans
e76b195c59 Moved all of the keynames out from driver-csi into termkey; where they belong 2008-10-08 02:00:22 +01:00
Paul LeoNerd Evans
9f7d84ba81 Register keynames using a more extensible internal array; easier to add new ones 2008-10-08 01:52:53 +01:00
Paul LeoNerd Evans
a80c10e90f Tiny bugfix to termkey.c's initialiser; actually handle multiple driver search properly 2008-10-08 00:53:59 +01:00
Paul LeoNerd Evans
10d3024a6a Pass an explicit 'force' parameter into driver's getkey rather than relying on non-zero waittime 2008-10-08 00:44:33 +01:00
Paul LeoNerd Evans
ac6cae29bb Moved single byte and UTF-8 sequence recombiner out of driver-csi.c back into termkey.c 2008-10-08 00:36:27 +01:00
Paul LeoNerd Evans
d46f72fc1a Moved all of the C0 registration and 'do_codepoint' logic out of driver-csi back into termkey via another protected method 'emit_codepoint' 2008-10-08 00:12:41 +01:00
Paul LeoNerd Evans
8407c53726 s/eatbytes/eat_bytes/ - nicer API name 2008-10-07 23:57:01 +01:00
Paul LeoNerd Evans
145dca73b2 Moved 'eatbytes' back into core code, put a code ptr in the termkey struct as a "protected" method 2008-10-07 22:22:59 +01:00
Paul LeoNerd Evans
8b7c2b5d4f Support a list of potential backend drivers 2008-10-07 03:17:06 +01:00
Paul LeoNerd Evans
d7358c43af Moved CSI key registration code to be private to CSI driver 2008-10-06 23:53:25 +01:00
Paul LeoNerd Evans
e3eca8d51a Use vtable in driver to indirect calls to the CSI driver 2008-10-06 23:36:14 +01:00
Paul LeoNerd Evans
f5c6ecf9af Moved CSI-related code out of termkey.c into new driver-csi.c 2008-10-06 23:27:19 +01:00
Paul LeoNerd Evans
e0671d1a01 Print Alt/Meta before Ctrl 2008-10-06 22:39:00 +01:00
Paul LeoNerd Evans
0b8680daa4 Added TERMKEY_FORMAT_WRAPBRACKET 2008-10-06 22:33:49 +01:00
Paul LeoNerd Evans
5b24e42d90 Added two more formatting options; CARETCTRL and ALTISMETA 2008-10-06 22:22:09 +01:00
Paul LeoNerd Evans
f54687c583 snprint_key() now takes a bitmask format, not a single boolean 2008-10-06 22:02:12 +01:00
Paul LeoNerd Evans
a06d010504 Added termkey_snprint_key() to render nice string outputs of key events 2008-08-21 20:20:07 +01:00
Paul LeoNerd Evans
95e87a86d5 Reworked events to be type/code/mod rather than flags/code/mod; make F[n] keys their own (parametric) type, rather than using keysyms for them 2008-08-21 20:05:17 +01:00
Paul LeoNerd Evans
db22cc6dc7 Preserve modifiers on XTerm's CSI 27 ~ modified Unicode sequence 2008-02-23 23:15:19 +00:00
Paul LeoNerd Evans
9dfd4f1116 Renamed describe_sym to get_keyname 2008-02-23 20:28:18 +00:00
Paul LeoNerd Evans
46e53d124d Moved termios magic out of demo.c into termkey.c where it belongs 2008-02-23 20:26:04 +00:00
Paul LeoNerd Evans
8f8e96f015 Implemented termkey_free() 2008-02-23 20:07:48 +00:00
Paul LeoNerd Evans
dda9be9110 More termios settings on startup, to ensure reporting of signal, flow control, and NL/CR keys 2008-02-23 19:43:05 +00:00
Paul LeoNerd Evans
696d5258a5 Make sure to initialise key->modifiers on unmodified CSIs 2008-02-23 19:39:24 +00:00
Paul LeoNerd Evans
efb04d3ee2 Rearranged Home/End keys to better suit rxvt's naming, note 1/4 are now Find/Select 2008-02-23 19:22:28 +00:00
Paul LeoNerd Evans
0962ee4f85 Recognise full CSIfuncs list of F1 to F20 keys 2008-02-10 20:39:22 +00:00
Paul LeoNerd Evans
14987e458c Bugfix for unknown CSIfuncs 2008-02-10 20:30:09 +00:00
Paul LeoNerd Evans
c36c12b53a Implement growing the buffer after input 2008-02-10 20:29:59 +00:00
Paul LeoNerd Evans
53b0d0aca9 More robust eatbytes() that guards against the buffer going negative, because size_t is not signed 2008-02-10 20:24:25 +00:00
Paul LeoNerd Evans
31414eac3b Implement waittime polling to try to distinguish Esc, 1 from A-1, etc.. on slow terminals 2008-02-10 20:22:33 +00:00
Paul LeoNerd Evans
c71e1928a2 Have 'termkey_advisereadable' return a value indicating if it's likely useful to call it again 2008-02-10 19:23:18 +00:00
Paul LeoNerd Evans
b3647c4861 Avoid a memmove() every character by storing an intial offset for the input buffer, and only moving when it's more than half way across 2008-02-10 19:15:29 +00:00
Paul LeoNerd Evans
354ba6b7c3 Allow registered keyinfo for C0/CSI/SS3/CSIfunc to override modifier bits; use this to implement Shift-Tab as CSI Z 2008-02-10 19:03:36 +00:00
Paul LeoNerd Evans
35d946e510 Also register 0x0d as another version of the ENTER key 2008-02-10 18:40:27 +00:00
Paul LeoNerd Evans
f76b62a65a Interpret XTerm's CSI 27 ~ as modified generic key, report keypresses as appropriate 2008-02-10 18:19:43 +00:00
Paul LeoNerd Evans
fd15f30120 Move most functionallity from getkey to 'do_codepoint()' 2008-02-10 18:13:17 +00:00
Paul LeoNerd Evans
516a1766a5 Bugfix to fill_utf8() to make it actually work right 2008-02-10 18:12:19 +00:00
Paul LeoNerd Evans
9884031625 Allow C0 codes to be registered names like the CSI/SS3s 2008-02-10 17:46:48 +00:00
Paul LeoNerd Evans
dc9672603a Define an 'int' typedef called termkey_keysym to use as keysym values 2008-02-10 17:41:13 +00:00
Paul LeoNerd Evans
96adbe9741 Avoid use of GLib; use fixed-size internal arrays for CSI/SS3->keycode lookup 2008-02-10 17:34:05 +00:00
Paul LeoNerd Evans
1e9eb3719a Interpret 8bit SS3/CSI codes and remaining C1s as C-A-letter 2008-02-10 15:28:07 +00:00
Paul LeoNerd Evans
daed589b5c Handle (normal cases) of UTF-8 - still doesn't handle C1/UTF-8 range yet 2008-02-09 19:30:37 +00:00
Paul LeoNerd Evans
64d0b4cb70 Cope correctly with EOF 2008-02-09 19:01:49 +00:00
Paul LeoNerd Evans
1f6ae5e40d Replaced custom arg1/arg2 CSI parser with generic arg[16] one 2008-02-07 02:47:15 +00:00
Paul LeoNerd Evans
63ed80a897 Reworking of CSI/SS3/CSIfunc recognition; use registered numbers + names for keys, rather than hardcoded 2008-02-07 02:21:14 +00:00
Paul LeoNerd Evans
6294cca6f9 Denote general status with return codes, not special key symbols 2008-02-07 01:17:59 +00:00
Paul LeoNerd Evans
a503403226 Initial attempt 2008-02-07 00:58:41 +00:00