1
votes

I am developing an application with Qt/Embedded 4.8.4(c++ bindings).I found that enabling caps lock is not putting the characters in capital letter inside the edit-box. Here is a simple program for your reference, which is showing same behavior.

#include <QApplication>
#include <QMainWindow>
#include <QLineEdit>

int main(int argc, char **argv)
{
    QApplication a(argc, argv);
    QMainWindow *win = new QMainWindow(0);
    win->move(50,50);
    win->resize(500, 500);
    win->show();

    QLineEdit *edit = new QLineEdit(win);
    edit->move(30, 30);
    edit->resize(100, 30);
    edit->show();

    return a.exec();
}

In the editbox, characters, you are typing, will appear in small case , no matter you have set the caps lock state

Re: For you information I am using LinuxInput as the input driver for both of keyboard and mouse

1
Does pressing Shift work?sashoalm

1 Answers

0
votes

It is possible that the key map used by the Qt Window Server (QWS) is has the wrong setting for the caps Lock key (keycode 58). I had this problem and was able to fix it as follows.

To generate a custom keyboard mapping I followed the method in this post: Qt Embedded for Linux. Keyboard layout switching

However, before running kmap2qmap I edited the kmap file so that keycode 58 used Caps_Lock rather than CtrlL_Lock

I then passed the generated qmap file as an input to the keyboard driver:

export QWS_KEYBOARD="LinuxInput:keymap=/path/to/xx.qmap"
./myApp -qws