Important: Please read the Qt Code of Conduct -

Can I control the function keys of key through qt Application?

  • I am designing a secured application.
    In my application I have removed the title bar of login page, so user can not easily exit the application. But I have qt4.8.7 crosscompiled through qws so user can easily exit the application by pressing Ctrl+Alt+F7. Therefore, I want to control the keyboard funtionality through my application.

  • @Mijaz
    You can recognise and act on key presses in a Qt application. But whether on your OS/window manager the key sequence is first handled outside of Qt/your application I cannot say.

  • Lifetime Qt Champion

    @Mijaz said in Can I control the funtion keys of key through qt Application?:


    In linux that will/might switch the active console. What does it mean on your system / context ?

  • @mrjj @JonB
    In my application I will just interface the keyboard to the baord through OTG. I just want control the funtionality of keybaord through my application.

  • Lifetime Qt Champion

    I still have no clue what you mean / want :)

    So its android app and you connect a keyboard via OTG ?

    • . I just want control the funtionality of keybaord through my application.

    Im not sure that is poosible for an APP. you have to be a driver.

  • @mrjj
    After delpyment my project to board, if I try directly write value or text in the application on board then it will not work. But if I will go through the following step then can enter text or value directly from keyboard connected to the board through OTG.

    cd / project_directory where you deployed your project.
    ./Your_project -qws

    Once user get into the application he/she can use the functionality of the application. I have disabled the "x"close mark of my application in order to trap the user into the application. User should not go out of the application without permission. I have created login for exit application to get close the application.
    But the main issue I am facing now: user can easily go out from the application by Ctrl+Alt+F7 without any login permission.
    How I can solve this issue? I thought, I should dissable the funtion keys after entered to the my application but not get any command to do that.

  • Lifetime Qt Champion

    @Mijaz I'm quite sure you can't do this in Qt as Ctrl-Alt-Fx is handled by the OS.
    You will need to do it on OS level:

Log in to reply