Catching "+" key symbol from Mac keyboard



  • 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.


  • Moderators

    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.



  • 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.



  • 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! :)


  • Moderators

    @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


Log in to reply
 

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