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

Re: [pygame] How to get capital letters from key event



Or like this.

for e in pygame.event.get(): #set eventstates of keys and mouse to dictionary
		if e.type == QUIT: return # keys that stop the program
		if e.type == KEYDOWN :#may draw if it is a function key
			eventstates[e.key]=True
			if eventstates[K_RSHIFT]==True : # if Right shift key pressed then
				if eventstates[K_ESCAPE]== True : return #quit program

> I am implementing a TextLabel widget with pygame but I can't get capital
> letters. I get the name of pressed key with pygame.key.name(event.key),
> but when I pressed Shift+<letter> I do not get I expect.
>
> Do have I use a FIFO ?