[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] key objets



Gerrit Holl wrote:
Hi,

I propose to change Pygame's key behaviour to make it more object-oriented.
A key number could be a subclass of int, but supporting methods like
.isalpha() (Has the user pressed a letter?), .isarrow() (Has the user pressed
an arrow?). Too often, I see myself doing "if K_a <= key <= K_z". I think a
more high-level approach would be useful.
maybe you can use something like:
e.unicode.isalpha()
(where e is instance of Event)

but i'm new to pygame so sorry if i'm wrong