Keypressevent focus window



  • Hello

    I try to make a program that reads all the keyboard inputs. But now at first i only can read special caracters like enters and after a first enter i can read other keypresses. (the event wont activate before the enter)

    when i push a button at the window and then try to read characters it works fine. But if i go to another window and back to the program it doesnt work anymore until i push the button again.

    so i think it has something to do with active window. How can i resolve this


  • Qt Champions 2016

    Hi
    Since you are not telling how you did it, it can be many things.

    Have a look at this. it uses a global event filter. Might be of use to you.

    http://stackoverflow.com/questions/8009676/mapping-key-press-event-qt

    Remember to install it as eventFilter


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.