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

[pygame] key objets



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.

If making them an object is too heavy, functions like isalpha are useful
too.

Gerrit.

-- 
197. If he break another man's bone, his bone shall be broken.
        -- 1780 BC, Hammurabi, Code of Law
--
Asperger Syndroom - een persoonlijke benadering:
	http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
	http://www.sp.nl/