Important: Please read the Qt Code of Conduct -

KeyPressEvent()-Function: I want to use Capital-Letters

  • Hello everybody,

    i want to use the keyPressEvent-Function:I want to use small and capital letters, but its not working.

    case Qt::Key_V:
    case Qt::Key_Shift && Qt::Key_V:

    Is there other code for Capital letters? Thanks in advance

  • QKeyEvent::key():

    bq. See Qt::Key for the list of keyboard codes. These codes are independent of the underlying window system. Note that this function does not distinguish between capital and non-capital letters, use the text() function (returning the Unicode text the key generated) for this purpose.

  • For the rest you have "QKeyEvent::modifiers() ": But the API docs state that these are not reliable.

Log in to reply