RE: Fw: Re: [AD] messy allegro 5.0 stuff

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Laurence Withers writes:
> Somewhere in the small print in that sample API, I wrote that things 
> like escape, enter, etc. (anything unprintable is probably a good 
> generalisation) would be returned by scancode, not unicode.

But the problem there is, how do you define 'unprintable'? Seems
obvious at first, but it turns out that everyone has slightly 
different ideas of what this means. For instance I would be
extremely surprised if pressing Esc didn't generate 27, Tab
is 9, Enter 13, and ctrl+Enter 10. Likewise a lot of people are 
used to ctrl+A=1, ctrl+B=2, etc, but then how can you tell the
difference between Tab and ctrl+I?

I think it would be bad if the API didn't conform to standard
ASCII behaviours like Tab=9, but also bad if it threw away the
more detailed info that was used to create that simplified
ASCII representation. Ideally it would be nice to return modifier
key state as well (many apps care about ctrl+shift+up differently
to just up on its own).

> The Curses keyboard API has some really serious problems
[...]
> This is clearly not an acceptable way of doing things, and is why 
> lots of old applications use ctrl-a, ctrl-f, ctrl-n, etc. for 
> navigation

Actually it was the other way around: early keyboards didn't have
dedicated arrow keys, and people used ctrl+letter or function
keys for pretty much everything, so the designers of Curses felt
that their API was adequate. Which it was at the time, but it
is a total nightmare today because it assumes too much about how
people are going to use the keys, and modern PC keyboards aren't
the same as a VT52.

I say just give people all the info (both translated and raw)
and let them decide which they want to use. That way every app
can find out what it wants to know, even if it wants info totally
other to what any of us today might expect to be needed.

Otherwise, what will happen when somebody invents a new user
interface that uses only combinations of Esc, Tab, and Ctrl+P to 
enter text, and letters F-I as navigation controls? :-)


-- 
Shawn



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/