Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    How to detect key stroke/pressing combinations and disable them

    General and Desktop
    5
    17
    6332
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • U
      umen242 last edited by

      Hello im building full screen application , and i need to control the key stroke/pressing
      combination like : windows + d , ctrl+alt+dll , alt+tab and so on..
      what is the best way to do such handler ?

      1 Reply Last reply Reply Quote 0
      • D
        dangelog last edited by

        Platform specific code. Those keys are not even passed to an application.

        Software Engineer
        KDAB (UK) Ltd., a KDAB Group company

        1 Reply Last reply Reply Quote 0
        • U
          umen242 last edited by

          sorry i didn't understand

          1 Reply Last reply Reply Quote 0
          • L
            lgeyer last edited by

            I do not know for the others but there are certain key stroke combinations you cannot disable. CTRL+ALT+DEL is one of them.

            1 Reply Last reply Reply Quote 0
            • U
              umen242 last edited by

              ok but what about the others?

              1 Reply Last reply Reply Quote 0
              • G
                goetz last edited by

                Alt-Tab is handled by the OS too and used to switch applications.

                Unless you want to outrage your users you should not even think about fiddling around with that key sequences!

                http://www.catb.org/~esr/faqs/smart-questions.html

                1 Reply Last reply Reply Quote 0
                • U
                  umen242 last edited by

                  i need it with users agreed , its terminal application

                  1 Reply Last reply Reply Quote 0
                  • G
                    goetz last edited by

                    As peppe already mentioned, you will have to resort to platform specific code then. Qt provides no means to intercept this (wich is a good thing™ - IMHO).

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    1 Reply Last reply Reply Quote 0
                    • U
                      umen242 last edited by

                      ho no problem , i i know that Qt dosnt have any " automatic"
                      handler for this , i juts wanted to know which best "pattern"
                      or way to handle this

                      1 Reply Last reply Reply Quote 0
                      • L
                        lgeyer last edited by

                        I would go for "RegisterHotKey":http://goo.gl/KAD5K, which should work for any combinations besides CTRL+ALT+DEL.

                        As far as I remember there was a possibility to disable the task manager by setting HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr to DWORD:1 - perhaps this disables CTRL+ALT+DEL too.

                        1 Reply Last reply Reply Quote 0
                        • U
                          umen242 last edited by

                          im looking for Qt solution , not win32

                          1 Reply Last reply Reply Quote 0
                          • L
                            lgeyer last edited by

                            Well, i thought we agreed that there is no Qt solution and that you will have to use platform specific code.
                            [quote author="peppe" date="1317060189"]Platform specific code. Those keys are not even passed to an application.[/quote]
                            [quote author="Volker" date="1317067782"]As peppe already mentioned, you will have to resort to platform specific code then. Qt provides no means to intercept this (wich is a good thing™ - IMHO).[/quote]
                            [quote author="umen242" date="1317095537"]ho no problem , i i know that Qt dosnt have any " automatic" handler for this , i juts wanted to know which best "pattern"
                            or way to handle this [/quote]

                            1 Reply Last reply Reply Quote 0
                            • U
                              umen242 last edited by

                              why there is no ? i dont understand , there is keyevents in Qt , i just need good algorithm to use it right . basically i didn't what to write something if there is already implementation

                              1 Reply Last reply Reply Quote 0
                              • L
                                lgeyer last edited by

                                Probably an third-party library like "Qxt":http://libqxt.bitbucket.org/doc/tip/qxtglobalshortcut.html might provide what you are looking for.

                                1 Reply Last reply Reply Quote 0
                                • G
                                  goetz last edited by

                                  [quote author="umen242" date="1317109307"]why there is no ? i dont understand , there is keyevents in Qt [/quote]

                                  Start reading and understanding before crying about things you cannot change. The answers have been given already.

                                  [quote author="peppe" date="1317060189"]Platform specific code. Those keys are not even passed to an application.[/quote]

                                  [quote author="Volker" date="1317065718"]Alt-Tab is handled by the OS too and used to switch applications.

                                  Unless you want to outrage your users you should not even think about fiddling around with that key sequences![/quote]

                                  And regarding the rest:

                                  [quote author="umen242" date="1317109307"]i just need good algorithm to use it right . basically i didn't what to write something if there is already implementation [/quote]

                                  You have been told multiple times that there is no platform independent means in Qt. Crying out loudly will not change this situation in any bit involved. So I suggest you save your time and start coding.

                                  http://www.catb.org/~esr/faqs/smart-questions.html

                                  1 Reply Last reply Reply Quote 0
                                  • U
                                    umen242 last edited by

                                    ok ...

                                    1 Reply Last reply Reply Quote 0
                                    • G
                                      giesbert last edited by

                                      Qt is meant to write applications that run in a platform independent way, for the most parts. There might be some that will not be handled by Qt, e.g. if you want to do some stuff that is rearly used, like hooking system events and handle them instead leaving them to the system.

                                      Those things must be done in an OS dependent way. QT is no 100% OS abstraction, otherwise it would have to emulate all features that windows has and Linux not on Linux and perhaps on MAC, and vice versa.

                                      Nokia Certified Qt Specialist.
                                      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post