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

Author Topic: Can't get KeyPressed event to work on SFML Widget in Qt  (Read 1074 times)

0 Members and 1 Guest are viewing this topic.

Darksshades

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
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
« Last Edit: March 24, 2014, 03:40:00 am by Darksshades »