I was playing with an idea that I found on TIBD. I thought that it would be really cool if we could open the string menu or Pic menu and have access to all 256 tokens. Sorry if I got your hopes up, because that has failed (so far). To get it to work, I might have to do a hackjob, but I did uncover a random tidbit of info.
When the OS calls your hook, if it is sending A=1, then you will want to exit with the z flag set. I do this with
xor a \ ret. What I found was that we can change the token to be displayed from here without having to write a whole table. How do we do this? DE contains a
extended keycode that maps to a token. All you have to do is change this value and the token that will be displayed gets changed. What I did, since my tokens were based on the menu item number and the token was arbitrary:
;E contains the Pic number
ld d,60h ;Start of a Pic token
bcall(_TokToKey) ;4A0Bh Stores the extended key code to 8446h, A has the rest
ld de,(8446h) ;E know has the extended value
ld d,a ;DE now has the whole keycode
xor a
ret
I don't know where else this might prove useful, but have fun