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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Darksshades

Pages: [1]
1
Graphics / Can't get KeyPressed event to work on SFML Widget in Qt
« on: March 24, 2014, 02:38:04 am »
This is probably something I did wrong or some missing property but I can't get the SFML to get any events other than mouseMove and keyReleased. sf::Keyboard::isKeyPressed works fine, but I need pollEvent to get the actual key down event and textEntered.

Code: [Select]
sf::Event event;
while ( pollEvent(event) ) {
    qDebug() << "PRESS" << event.type;
    mEstadoAtual->events(event);
}

The following code inside a SFML widget only gets me:
PRESS 10
PRESS 6
for mouseMove and keyreleased

Does anyone know why thats happening and how to fix it?
The implementation of the base sfml widget I used is from: http://sfml-dev.org/tutorials/1.6/graphics-qt.php

Edit: Sorry, posted in the wrong forum, should be in Help->Window

Edit2: Setting setKeyRepeatEnabled(true); makes the event appear(event 4 and 5, textentered and keypressed), stiil no MouseButtonPressed tho.
Also, if I press ESC, although nothing happends, the event return back to the state of only showing keyReleased events

Pages: [1]
anything