OSDN Git Service

This is the result of merging in what the current Angband, 4.2, has for main-cocoa...
authorEric Branlund <ebranlund@fastmail.com>
Mon, 26 Aug 2019 00:29:52 +0000 (17:29 -0700)
committerEric Branlund <ebranlund@fastmail.com>
Mon, 26 Aug 2019 00:29:52 +0000 (17:29 -0700)
commitfa77dc04190200a56ccfb162494e86e828e57885
treeb585198124a3c958061805c19823aad66da10134
parente9f281667582b47effafafa87b4c67fb4ae993d8
This is the result of merging in what the current Angband, 4.2, has for main-cocoa.m and hacking the result to work with Hengband.  Since the key handling in Hengband is not like what Angband and poschengband have, adopted a strategy similar to what's used in main-win.c and main-mac.c:  keys that fall in the ASCII range (0 - 127) get sent as is, certain special keys are mapped to the equivalent in the original keyet (arrow keys going to '2', '4', '6', '8'; help function key to '?'; delete function key to '\b'; return and keypad enter to '\r'; escape, tab, and delete to '\033', '\t', and '\b', respectively), others are converted to a macro trigger which includes the modifiers and two characters encoding the key, still others just get mapped to a null character before sending since it wasn't clear to me that it was possible to encode the 16-bit value that the application gets for the key into something that would fit in a macro trigger.  Another significant change from the poschengband/Angband version is that their use of overdraws had a bad artifacts when used without modification.  I ended up dropping the overdraws and instead use a slightly larger clear rectangle in Term_text_cocoa() and use the same logic for the clear rectangle in Term_wipe_cocoa() as in Term_text_cocoa().
src/main-cocoa.m