Unicode input and CTRL-D in OS X

33 views
Skip to first unread message

Paul Lalonde

unread,
Mar 3, 2009, 12:35:15 AM3/3/09
to acme...@googlegroups.com
I did some more digging on why I wasn't getting ctrl-D delivered to
my acme session, and have tracked it down.

The unicode handling chokes it out. The convert_unichar() function
is particularly rude to many of the low-valued control sequences -
ctrl-D gets mapped to kEnd, and 0x4 is lost forever :-(

My inclination is to dump most of those conversions, since they seem
to only affect the use of "special" keys, which I don't use.

Does anyone have a more elegant solution?

Paul

underspecified

unread,
Mar 12, 2009, 10:41:55 AM3/12/09
to acme...@googlegroups.com
Greetings,

Looks like this mail slipped by me ...

I would try adding a check to handle_kdb_event() to see if controlKey
is pressed.
If it is, then just pass the keystroke value through without calling
convert_unichar().
I'm a bit busy right now, but if this works, I will update Acme SAC
accordingly when
I get a chance, though I would welcome any patches :-D

--underspecified

Paul Lalonde

unread,
Mar 12, 2009, 11:53:05 PM3/12/09
to acme...@googlegroups.com
The problem with this is that the text gets handled
handle_text_input_event() instead of making it the kbd handler; the
right answer is probably to return eventNotHandledErr from
handle_text_input_event() if controlKey is pressed, but I worry that
that might kill some unicode input that I'm not familiar with, since
I use almost no unicode.

If there is no useful unicode inputs using the control key, I'll go
ahead and make you a patch.

Paul

underspecified

unread,
Mar 14, 2009, 12:09:12 AM3/14/09
to acme...@googlegroups.com
Paul,

I typically only generate unicode input using Apple's IME, so I am not
sure what unicode input there is that uses the control key.
What you said about text getting handled in handle_text_input_event()
is true with a caveat: only input events that produce fully-formed
unicode characters will a TextInputUnicode event of some kind. So just
pressing the Control key is going to generate a keyboard event with
controlKey set to 1 in the keyboard event's kEventParamKeyModifiers.
To handle Control+something events,
we probably need a variable that reflects whether the Control key is
being help down and uses that to decide whether to call
convert_unichar(). At any rate, I would like to give your solution a
try too, so please send me a patch.

--underspecified

Reply all
Reply to author
Forward
0 new messages