Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Catching "+" key symbol from Mac keyboard
Qt 6.11 is out! See what's new in the release blog

Catching "+" key symbol from Mac keyboard

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.7k Views 1 Watching
  • 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.
  • X Offline
    X Offline
    xtingray
    wrote on last edited by xtingray
    #1

    Hi!
    Currently I am trying to detect a key press event, specifically I want to catch the "+" character. I am doing a basic proof from Mac using a keyboard in Spanish (https://pixabay.com/static/uploads/photo/2013/07/13/10/41/apple-157580_960_720.png)

    The funny thing is that I can capture any key event but "+". I am using the constant "Qt::Key_Plus" to catch it, nevertheless when I press "+" no key event is generated at all.

    I wonder if someone else can confirm if this is an specific Qt bug either for Mac or for my key layout. Thanks.


    Qt Developer

    ValentinMicheletV 1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      in case you haven't done yet: you could install an eventfilter on the QApplication and output the attributes of every keyevent.
      At least this excludes the possibility that the keyevent for the "+" key is already consumed by another object.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • X xtingray

        Hi!
        Currently I am trying to detect a key press event, specifically I want to catch the "+" character. I am doing a basic proof from Mac using a keyboard in Spanish (https://pixabay.com/static/uploads/photo/2013/07/13/10/41/apple-157580_960_720.png)

        The funny thing is that I can capture any key event but "+". I am using the constant "Qt::Key_Plus" to catch it, nevertheless when I press "+" no key event is generated at all.

        I wonder if someone else can confirm if this is an specific Qt bug either for Mac or for my key layout. Thanks.

        ValentinMicheletV Offline
        ValentinMicheletV Offline
        ValentinMichelet
        wrote on last edited by ValentinMichelet
        #3

        Hi,

        I tested keyReleaseEvent on Ubuntu 14.04, using Qt 5.3.0: both plus (from numbers and num pad) are recognized on an azerty keyboard.

        1 Reply Last reply
        1
        • X Offline
          X Offline
          xtingray
          wrote on last edited by xtingray
          #4

          Initially I was assuming that there was a Qt bug related to the keyboard event implementation specifically for Mac. But, in the end I decided to try a basic program ("hello world" style) to catch keyboard events so I could prove that actually the error was on my project source code. In my design, there are "key catchers" in several layers, so the "Plus" event was being ignored from a high level class I haven't checked before.

          Thank you anyway for your help! :)


          Qt Developer

          raven-worxR 1 Reply Last reply
          0
          • X xtingray

            Initially I was assuming that there was a Qt bug related to the keyboard event implementation specifically for Mac. But, in the end I decided to try a basic program ("hello world" style) to catch keyboard events so I could prove that actually the error was on my project source code. In my design, there are "key catchers" in several layers, so the "Plus" event was being ignored from a high level class I haven't checked before.

            Thank you anyway for your help! :)

            raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on last edited by
            #5

            @xtingray said:

            In my design, there are "key catchers" in several layers, so the "Plus" event was being ignored from a high level class I haven't check before.

            exactly to such ("consuming object") was i referring in my first post

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved