Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Key code problem  (Read 4010 times)

0 Members and 1 Guest are viewing this topic.

sebastiend

  • Newbie
  • *
  • Posts: 9
    • View Profile
Key code problem
« on: March 18, 2008, 01:06:02 pm »
I encounter something strange:

Code: [Select]
from PySFML import *
     
if __name__ == "__main__":
    global window
    window = sf.RenderWindow(sf.VideoMode(800, 600, 32), "SFML Window")
    global running
    running = True
    while running == True:
        evt = sf.Event()
        while window.GetEvent(evt):
            if evt.Type == sf.Event.Closed:
                running = False
            if evt.Type == sf.Event.KeyPressed:
                print evt.Key.Code
        window.Display()

This display 51 each time I press a key indepently of the real code.
Could it come from my compilation or system as I use a 64 bits Fedora?

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
Re: Key code problem
« Reply #1 on: April 20, 2008, 02:05:11 am »
Quote from: "sebastiend"
I encounter something strange:

Code: [Select]
from PySFML import *
     
if __name__ == "__main__":
    global window
    window = sf.RenderWindow(sf.VideoMode(800, 600, 32), "SFML Window")
    global running
    running = True
    while running == True:
        evt = sf.Event()
        while window.GetEvent(evt):
            if evt.Type == sf.Event.Closed:
                running = False
            if evt.Type == sf.Event.KeyPressed:
                print evt.Key.Code
        window.Display()

This display 51 each time I press a key indepently of the real code.
Could it come from my compilation or system as I use a 64 bits Fedora?


Strange, what version of PySFML are you running (1.2 or svn)?
(Sorry I'm a month late, but you should add [PySFML] in front of the subject when it has something to do with PySFML, so i can quickly spot it.)

 

anything