Ignore key_mouse unless it is exactly \e[M because some terminfos relate to different encoding modes (thanks Ninji)
Bumped VERSION to 0.22
Perform t/40ti-override.t on made-up terminal name to ensure it works
Ensure that a TI getstr hook function can invent key strings even on made-up terminals that terminfo doesn't know
Remove a pointless (and warny) cast
Fix offbyone buffer overflow in sprintf calculation of key names (neovim #9630)
Bugfix to missing TERMIOS support
Bumped VERSION to 0.21
Write the version into the .pc file at 'make install' time so we don't get@VERSION@ from source
win32: Win32 has no <strings.h> and needs help getting strcasecmp()
win32: Win32 has no poll() so cannot provide termkey_waitkey()
win32: Win32 has no <termios.h>
win32: Win32 needs help to get ssize_t
win32: Win32 lacks <unistd.h> and S_ISFIFO()
Avoid nonstandard \e sequence in unit tests (via neovim https://github.com/neovim/neovim/blob/master/third-party/patches/libtermkey-Fix-escape-sequences-for-MSVC.patch)
Perform TI string lookup by iterating all the strings we care about, rather than iterating everything in the DB; that way a hook function can invent new strings
driver-ti.c does not need a separate TYPE_MOUSE node type since TERMKEY_TYPE_MOUSE already exists
Bugfix memory leak in TI driver on xterm
Remember to unibi_destroy() even if we never (lazily) loaded terminfo
Fix valgrind uninitialised value warning
Fix a couple of valgrind-cleanness errors in DEBUG mode
Bugfix for infinite CPU spin on TERM=dumb, which has no terminfo key strings
Implement mouse key parsing (thanks Marc André Tanner <mat@brain-dump.org>)
Build termkey.pc by invoking a small shell script instead of sed'ing a template
Apply typo fixes from @jamessan
Fix various spelling mistakes found by codespell & Vim
Bumped VERSION to 0.20
Bugfix DCS/OSC handling with non-empty buffer
Also unit-test false alarms of OSC/DCS
Add TERMKEY_TYPE_DCS/OSC
Renumber t/39csi.c to 38 to make space at 39
Neater implementation of peekkey() in CSI driver by using nested switch blocks
Bumped VERSION to 0.19
Capture t/40ti-override.c
Add a (currently-undocumented) way for callers to override terminfo database lookups
Defer loading of terminfo database until first 'start' call
Define a 'NOSTART' flag
Include <unistd.h> for write+pipe (thanks jamessan)
Endian fix for unicode keys (thanks jamessan)
Bugfix for keypad mode switching unibilium/TI driver (thanks Přemysl Janouch)
Correct handling of ASCII NUL to imply Ctrl-Space
Bumped VERSION to 0.18
Also disable the IEXTEN lflag, on platforms that define it
Bugfix to previous commit - call pkgconfig, not call pkg-config
Wrap pkg-config in a Make function so that PKG_CONFIG_PATH=... works as a makevar
The Ctrl-H byte (0x08) shouldn't automatically become SYM_BACKSPACE
Need to apply 'override' in all cases of CFLAGS/LDFLAGS in Makefile
Specify 'override' when setting initial CFLAGS (requested by tarruda)
Be a little more lenient in locale env.var. testing for UTF-8ness
Unit tests should use .code.codepoint/.sym instead of not .code.number when appropriate
Try tinfo before ncursesw (partially from https://github.com/o11c/libtermkey/commit/c2dd8f247a2ef9bce5ce26bfb289369643f58e09) [thanks o11c]
Make header compatible with C++ (from https://github.com/o11c/libtermkey/commit/ddd7b0c5aa10bb62dc2f7673414e9a00f11ff447) [thanks o11c]
Look for .utf8 in locale variables as well as .UTF-8
Print UTF-8/RAW mode on startup; print 'Key ' before normal keys to debug UTF-8 parse errors
Bump VERSION to 0.17
Better abstraction of C compiler by using the $(CC) Make variable
Invoke libtool cc instead of libtool gcc, for those platforms now using clang (FreeBSD 10)
Look for \.UTF-8 only in the first env. var found from LANG, LC_MESSAGES, LC_ALL
Add TERMKEY_FORMAT_URWID shortcut [thanks Romain Chossart]
Bugfix to snprint_cameltospaces() when given a short buffer [thanks Romain Chossart]
Delete trailing whitespace in code
Docs fix - fullstop at end of sentence
Fix comment about 'n' in strpncmp_camel()
Minor doc update - strpkey expects strings, doesn't use them
Added TERMKEY_FORMAT_LOWERSPACE for strpkey() also
Added TERMKEY_FORMAT_LOWERSPACE for strfkey() only
Added TERMKEY_FORMAT_LOWERMOD
Added TERMKEY_FORMAT_SPACEMOD
Make some more things 'const' that should be
Updated shared taplib
Make sure to implement newer event types in debug function
Bump VERSION to 0.16
Further documentation clarifications on the 'code' field of a key event
Handle ANSI and DEC mode report CSIs
Only recognise DECCPR as a position report, so it is distinct from F3
Try to handle position reports -and- F3 concurrently.. somehow.. argh
Bugfix to argless CSIs; present 0 arguments, not 1 whose value is -1
Slightly more generic custom CSI handling - name functions just after the letter they parse, so we can multiplex on 'cmd' or other things
Moved the other termkey_interpret_*() functions into driver-csi.c where they arguably belong
Make the generated termkey.h file readonly
Also interpret an intermediate CSI byte if present
Unit test that CSI initial command also works
Return a real key type for unrecognised CSI sequences; allow accessing them by termkey_interpret_csi()
Split out the actual CSI parser into its own function, separate from peekkey_csi
Install library using  libtool install  rather than  libtool cp --remove-destination  because the latter is non-portable
Make sure to 'make clean' includes demo-glib
Bugfix to POSITION reporting - swap line<=>col
Have demo.c request cursor position on '?'; print position reports and mouse nicer
Many small manpage markup fixes
Bump VERSION to 0.15
Ensure that key->type field is properly set for all mouse encoding protocols
Documentation on new TERMKEY_TYPE_POSITION events
Also handle CSI R; position report replies to CSI 6n
Neater CSI driver; dispatch command handlers from an array
Always load the CSI driver because it contains cross-terminal mouse and CSI u handling
Created abstract accessors for getting/setting key event line/col counts
Added some notes about what mouse protocols are supported
Also pass 'index' argument to man-to-html.pl
Note the limited range of mouse line/column number
termkey_interpret_mouse takes const key, does not set modifiers, as that's already done
Use spare bits in code.mouse[3] to store bigger mouse positions
Allow setting mouse encoding protocol from demo
Recognise SGR-style mouse encoding
Recognise rxvt-style mouse encoding
Extract modifiers for mouse events at peekkey time
Added a unit test for mouse report events
Created a demo to show libtermkey in a GLib-based program
Fix manpage bug in termkey_start.3
Bump VERSION to 0.14
Need to ship man/also in distribution tarball
Also pack the unit tests into the dist tarball, and allow building them in-target
Avoid the underscore in  struct _TermKey
Consistency updates to Makefile to make it more like libvterm's
Added documentation for termkey_{start,stop}, termkey_is_started
Use man/also for manpage aliasing rather than duplicating the list (incorrectly) in the Makefile
Have getkey/waitkey return RES_ERROR/EINVAL if stopped
Added a termkey_is_started() accessor; unit test it a bit
Move the terminal start/stop code into their own functions, exported (undocumented for now)
Also link to termkey_{get,set}_buffer_size(3) from termkey(7)
Bump VERSION to 0.13
Optionally build against libncursesw if unibilium isn't present, before falling back on plain libncurses
Added manpage for termkey_{get,set}_buffer_size
Added (undocumented) termkey_set_buffer_size()
Added (undocumented) termkey_get_buffer_size()
Document the errors set by termkey_new(), use errno rather than fprintf() to stderr
Symlink manpage for termkey_new_abstract
Use termkey_new_abstract() in unit tests
Created termkey_new_abstract()
Move initialisation logic out of termkey_new into a static function
Use termkey_set_flags() in constructor rather than copypasted logic
Split termkey_new() into alloc and initialise phases
Also mark termkey.c's modnames as static
Mark new driver-csi internal variables as static so they don't result in linkable symbols
Fix 'make dist' target for new man/ subdir
Bump VERSION to 0.12
Also mkdir MAN7DIR at install time
Various other minor fixes to manpages
Ensure that 'make htmldocs' rebuilds built manpages
Fix Makefile for manpage generation of new man/termkey.7
Removed note about termkey_keycmp() not canonicalising key structures, since it does in fact do exactly that
Fix some typoes in termkey_set_canonflags.3
Link to termkey(7) from other manpages, delete some of the duplicated sections
Initial stab at termkey(7) manpage
Note in termkey_new(3) that the caller has to init. the terminal in abstract or pipe cases
Don't try to write() the start/stop string if the fd is a pipe, because this will never work
Fix another printf() %c char
Handle realloc() failures when registering key names
Since CSI key info is the same for every CSI driver, just store one static copy of it rather than one for every termkey instance - simplifies construct-time allocation
fprintf() %c wants char, not unsigned char
sscanf() %zn ought to take a ssize_t *
Allow {start,stop}_driver to fail, abort constructor, have driver-ti try to write the entire start/stop string or error out on -1
(void)-cast calls to write() in driver-ti start/stop since we don't -really- care if they fail, there's not much we can do about it
\e string escape is not portable; use \033
Delete trailing comma in enum{} to keep C++ happy
Use only C89 commenting style in .h file, in case of C89 compilers or similar that want to link
More minor docs updates
Use the 'also' list for aliased pages
Minor wording fixes to termkey_push_bytes.3 manpage
Fix 'htmldocs' Makefile target
Allow passing fd = -1 to constructor to make an instance not associated with an fd; must use push_bytes to provide it input
Added termkey_push_bytes(), a new API for providing input bytes
Move the growing collection of manpages into their own man/ subdirectory
Ensure that termkey_advisereadable() just fails with errno=ENOMEM rather than trying to read() zero bytes
Avoid push_bytes() entirely by read()ing directly into tk->buffer
Provide new API function to determine how much buffer space remains in the instance
Remove termkey_pushinput() from external API; declare static, rename it
Bump VERSION to 0.11
Minor manpage link fixups
Optionally support unibilium for reading terminfo instead of curses
Abstract out ld flags in Makefile
Neaten logic by loading terminfo strings in a separate function from the constructor
Bumped VERSION to 0.10
Canonicalise (a local copy of) the key structures given to termkey_keycmp() before comparing them
A few more DEBUG fprintf(stderr)s at construction time
Handle TERMKEY_RES_ERROR in (debugging mode) res2str()
Use $(VERSION) to set DISTDIR in Makefile, so make VERSION=... dist overrides its name
Allow a flag to convert ASCII DEL into Backspace
Move canonicalisation flags into their own bitfield with their own accessor and named constants
Remember to symlink termkey_get_flags(3) manpage at install time
Provide an explicit termkey_canonicalise() function; canonicalise Space/SP in both directions
Deleted legacy type name typedefs and declaration of termkey_snprint_key()
Added a unit test to assert the correct behaviour of FLAG_SPACESYMBOL from waitkey
<poll.h> on Solaris needs _XOPEN_SOURCE 600 to ensure it gets sigset_t - Petr Pavlu
optarg and friends want _XOPEN_SOURCE 600, and <unistd.h> - Petr Pavlu
strdup() needs 'define _XOPEN_SOURCE 600 - Petr Pavlu
Ensure c_cc[VMIN] and c_cc[VTIME] are properly defined, because Solaris seems not to set them - Petr Pavlu
Link against -lcurses not -lncurses, because these two might be different on some OSes (e.g. Solaris) - Petr Pavlu
Bumped VERSION to 0.9
Provide a flag to return RES_ERROR even on signal (EINTR); without it, retry the operation
Provide a new result value, TERMKEY_RES_ERROR to indicate an IO error - preserve errno
Include a LICENSE file
Put LIBDIR and INCDIR directly in termkey.pc; don't indirect via PREFIX as it might be incorrect
Mouse position coordinates are unsigned
Ignore VDSUSP as a signal-sending key too, if platform defines it
sscanf'ing a size_t requires %zn
Bumped VERSION to 0.8
Gracefully ignore read() yielding EINTR rather than bailing out
Use _POSIX_VDISABLE rather than hardcoded 0 to disable individual entries in termios.c_cc; most BSDs use 0xff rather than 0 for this value
Disable ISIG mode entirely if FLAG_CTRLC is set
Also handle new 'fixterms' spec CSI codepoint;modifiers u encoding
demo.c needs to enable CTRLC flag to shut down mouse mode on exit
Bugfix to termkey_keycmp - implement sense in correct direction
Bugfix termkey_strpkey parsing unicode with trailing content
Assert that termkey_strpkey's return points to endofstring after parse
Bumped VERSION to 0.7
Solaris requires #define _XPG6
Refer to strfkey not snprint_key; add links to termkey_keycmp
Fixed another couple of typoes in manpages
Various minor neatenings to manpage formatting
Bugfixes to manpage layout - no need to .br when the demo is pulled in a .nf anyway; remember to escape slashes
Provide termkey_keycmp() for sorting purposes
Docs fix for termkey_strfkey
Add a couple more 'const' markings to API functions where appropriate
Adjust termkey_strpkey() API more like strptime(); return pointer to end of recognised section, allows for stream parsing
Provide a termkey_lookup_keyname that can do partial buffer parsing
Initial manpage for termkey_strpkey
Ensure strpkey can parse numbered function keys
Unicode codepoint is stored in key->code.codepoint, not code.number
Partial implementation of termkey_strpkey(3); missing FORMAT_WRAPBRACKET and TYPE_FUNCTION support
Neater implementation of key modifier names for strfkey; put them in a little table
Extract UTF-8 sequence parser into its own function, fix bugs, apply unit tests
Added unit tests for UTF-8 parser
Updated manpages for function rename sprint_key -> strfkey
Added some unit tests for termkey_strfkey(3)
strfkey should fill in the utf8 member of a key struct if it's empty
#include termkey.h from the correct path in unit tests
Added some unit tests for keyname <=> sym constant conversions
taplib's is_str() should take const char *
Added some unit testing for termkey_getkey(3) and friends
is()-like testing for ints and strings
Remember to exit with exit_status() from unit testing
Created a little Test::More-like library for TAP testing
bzr ignore t/*.t
Created a unit-testing system using perl's prove
Renamed snprint_key() to strfkey(); provide redirection trampoline
Minor whitespace fixes in termkey.h.in
Provide guarded  extern "C" { ... }  wrapper for C++ compilers
C++ compilers don't like trailing commas in enums; remove them
include <curses.h> before <term.h> as it's required in that order on Solaris
Bumped VERSION_MINOR to 0.6
Don't steal Ctrl-C from the kernel by default (so leave SIGINT enabled); add a flag to take it if required
Interpret space as Unicode by default, add a flag to make it symbolic instead
Allow formatting the mouse position when rendering an event to a string
Make DEBUG=1 mode work with mouse events
Moved code around so DEBUG=1 actually compiles again
Return opaque mouse events in the key structure; add a function to interpret this into its component fields
Implement mouse catching also in CSI driver, in case xterm-alike terminal without 'key_mouse' terminfo string
Moved mouse parsing code out of driver-ti.c into core termkey.c
Remember to zero key->modifiers for mouse events
Supply --tag=CC to libtool to inform it we're a C library; in case it doesn't detect that (mumble openbsd mumble)
Bumped VERSION_MINOR to 0.4
Complete reworking of build system to use libtool
Document the new mouse reporting interface
Implement XTerm mouse parsing in terminfo driver
Make demo enable mouse mode if given on commandline
Print Mouse() rather than shouting MOUSE()
Public interface for MOUSE support
Bugfix to termkey_format_key() in FORMAT_CARETCTRL case when formatting Ctrl-Letter
Cope with building distdir at minor versions .3 (otherwise it clashes with *.3)
Renamed all type names to CamelCaseNames for visual distinctness, separate from variables/functions
Substitute version into termkey.pc.in at 'make dist' time
Bump VERSION_MAJOR to 0.2
Represent Ctrl-letter in lowercase in the struct, so as one day to be able to do Ctrl-Shift-letter. Make sure ^X notation is still capital
Resort back to using GNU sed in .sh built manpages, as we only need them at 'make dist' time now; doesn't matter that BSD can't run them
Make termkey_getkey() set a peeked key structure if it returns TERMKEY_RET_AGAIN
Complete change of driver internals - peek and return size but don't eat bytes; eat later in getkey()
Linefeed properly in main() in demo files
Documentation fix for termkey_get_fd - returns int, not void
Make sure only to slide buffer down when returning a real key to the user, or else it might upset the meta-key logic when it returns
Make common static function getkey(), roll functionallity of termkey_getkey{,_force}() into it
strdup() the terminfo keypad_local and keypad_xmit strings at construct time, in case multiple instances and they change beneath us
Use a C99 flexible array member rather than the [0] hack
Added termkey_keyname2sym() to API
Added termkey_get_fd() to API
Extra documentation about the three types of key event structure, and what the code members mean
Use shell natively to embed demo .c files in manpages rather than invoking sed, because OpenBSD's sed doesn't seem to like this
Cast 'term' to (non-const) char* when passing to setupterm() because terminfo's prototypes don't use const
Use sizeof() on assigned variables rather than types, to make code a little less fragile to type changes
Make on_key() static in demo-async.c to shut up silly GCC warnings
Fixed another signed-vs-unsigned int comparison in driver-ti.c
Make sure l is always initialised in termkey_snprint_key()
Make termkey_new_full() static for now until we expose the API fully
Fixed some signed/unsigned integer mismatches, including one important bug
Export a gzip rather than bzip2 archive
Bump VERSION_MINOR to 0.1
Remove actual .so file on 'make clean'
Install to SONAME.MINOR and symlink to SONAME and basename
Only print about unrecognised terminfo variable names when debugging
Also added 'make dist' target to build distribution tarball
Split Makefile into two halves; added 'make distdir' target for building distribution tarballs
Document the TERMKEY_CHECK_VERSION macro
Better Makefile support for built manpages and termkey.h file
Added .bzrignore patterns for other built files
Added compile-vs-runtime library version checks
Store major and minor version number in Makefile; substitute #defines in termkey.h at build time
Compress trie nodes down to extent maps after loading, to save memory
Use a trie instead of a linear list of sequence strings in the terminfo driver - nicer lookup properties
Handle malloc() failures during setup of driver-ti
Make CSI driver's debugging output messages on unrecognised sequences conditional on #ifdef DEBUG
CSI driver shouldn't eat sequences it doesn't understand; leave them for another driver
Bugfix to 'unknown CSI' case in CSI driver - neater output message to avoid uninitialised ints
Added documentation on termkey_{get,set}_flags()
Added (undocumented) termkey_{get,set}_flags() calls to API
CSI driver should also load when TERM=screen because of screen's stupid way of blind-forwarding keypresses it doesn't understand
Implemented free_driver() in terminfo driver
When debugging, also print details of a key event when applicable
Load terminfo triver before CSI; in case they both apply
Allow stacking drivers in a linked list; try all of them at getkey() time
If debugging, print verbose output about internals of getkey operation
Driver getkey() can return TERMKEY_RES_NONE which attempts getkey_simple() afterwards
getkey_simple() should return TERMKEY_RES_NONE if no bytes available; as a safety check
Print name of driver on startup if debugging
Drivers have names
Pass driver_info as explicit void* parameter into driver methods
Pass 'csi' value to static helper functions in driver-csi
Renamed termkey_{set,get}waittime() to termkey_{set,get}_waittime() to be more consistent
Don't document the termkey_free() function as it doesn't restore termios; document termkey_destroy() instead
Include demo.c and demo-async.c in the manpages under an EXAMPLE section
Added asynchronous demo which uses poll()
Also document termkey_advisereadable()
Added manpages for (most of) the external API functions
Neater bitfield constants in .h file; added docs of TERMKEY_FORMAT_* constants
Make sure all .c->.o builds depend on all .h files
Better handling of incomplete UTF-8 sequences - just emit a UTF8_INVALID if waittime is up
Better handling in termkey_waitkey() of EOF conditions
Reuse common Esc-prefix code in getkey_simple() from CSI driver; avoids code duplication
Bugfix to recursive 'meta-' getkey code - handle buffcount too
Some platforms need -fPIC when compiling C code for eventual use in a shared library
Recognise 'key_mouse' as an ignored terminfo key
Install a .pc file so that pkg-config works
Terminfo driver needs to put terminal into 'keypad_xmit' mode when starting
Added new driver virtual methods 'start_driver' and 'stop_driver'
Remeber to handle Esc-prefixed keypresses in base getkey_simple() function - involves some code duplication with CSI driver currently
Pass the 'force' value through to getkey_simple()
Added 'make install' target
Adjusted Makefile to build a shared library
Added many more key symbols and names + translations from terminfo
Binary search terminfo funcname => termkey sym conversion, rather than linear
'int' might not be wide enough to hold any Unicode codepoint; use 'long'
Added some TODO notes about handling realloc() failures
Better free() tracking in constructor failure cases
Respect user's CC and CFLAGS
Gracefully handle constructor failure rather than SEGV
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
Adjustment to demo.c; just print the vim style format
Added initial attempt at a terminfo-driven driver
Moved all of the keynames out from driver-csi into termkey; where they belong
Register keynames using a more extensible internal array; easier to add new ones
Tiny bugfix to termkey.c's initialiser; actually handle multiple driver search properly
Pass an explicit 'force' parameter into driver's getkey rather than relying on non-zero waittime
Moved single byte and UTF-8 sequence recombiner out of driver-csi.c back into termkey.c
Moved all of the C0 registration and 'do_codepoint' logic out of driver-csi back into termkey via another protected method 'emit_codepoint'
s/eatbytes/eat_bytes/ - nicer API name
Moved 'eatbytes' back into core code, put a code ptr in the termkey struct as a "protected" method
Support a list of potential backend drivers
Moved CSI key registration code to be private to CSI driver
Use vtable in driver to indirect calls to the CSI driver
Moved CSI-related code out of termkey.c into new driver-csi.c
Makefile now sensitive to DEBUG=1
Define 'TERMKEY_FORMAT_VIM' as a shortcut to make it format keys like Vim does
Print Alt/Meta before Ctrl
Added TERMKEY_FORMAT_WRAPBRACKET
Added two more formatting options; CARETCTRL and ALTISMETA
snprint_key() now takes a bitmask format, not a single boolean
Added termkey_snprint_key() to render nice string outputs of key events
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
Renamed .h file's include guard to avoid a C reserved identifier space
Cope correctly with XTerm's modified Unicode reporting of Ctrl-C for termination
Preserve modifiers on XTerm's CSI 27 ~ modified Unicode sequence
Renamed describe_sym to get_keyname
Moved termios magic out of demo.c into termkey.c where it belongs
Implemented termkey_free()
More termios settings on startup, to ensure reporting of signal, flow control, and NL/CR keys
Make sure to initialise key->modifiers on unmodified CSIs
Nicer names for modifiers on printed output
Rearranged Home/End keys to better suit rxvt's naming, note 1/4 are now Find/Select
Recognise full CSIfuncs list of F1 to F20 keys
Bugfix for unknown CSIfuncs
Implement growing the buffer after input
More robust eatbytes() that guards against the buffer going negative, because size_t is not signed
Implement waittime polling to try to distinguish Esc, 1 from A-1, etc.. on slow terminals
Have 'termkey_advisereadable' return a value indicating if it's likely useful to call it again
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
Allow registered keyinfo for C0/CSI/SS3/CSIfunc to override modifier bits; use this to implement Shift-Tab as CSI Z
Also register 0x0d as another version of the ENTER key
Interpret XTerm's CSI 27 ~ as modified generic key, report keypresses as appropriate
Move most functionallity from getkey to 'do_codepoint()'
Bugfix to fill_utf8() to make it actually work right
Allow C0 codes to be registered names like the CSI/SS3s
Define an 'int' typedef called termkey_keysym to use as keysym values
Avoid use of GLib; use fixed-size internal arrays for CSI/SS3->keycode lookup
Interpret 8bit SS3/CSI codes and remaining C1s as C-A-letter
Handle (normal cases) of UTF-8 - still doesn't handle C1/UTF-8 range yet
Cope correctly with EOF
Replaced custom arg1/arg2 CSI parser with generic arg[16] one
Reworking of CSI/SS3/CSIfunc recognition; use registered numbers + names for keys, rather than hardcoded
Denote general status with return codes, not special key symbols
Initial attempt