Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get a the actual keyname from hardware key-number/scancode in pure python OR: How to bind the key left of the [1] to a shortcut in Qt
    primarykey
    data
    text
    <p>My final goal is to bind the key left of the [1] key to a shortcut in pyqt, no matter what keyboard layout (qwerty, qwertz, azerty...). That is not supported by qt directly.</p> <p>So either I am looking for a way that was not mentioned in the Qt docs (or hidden somewhere) or, more likely, a way to pre-process the keys in pure python before that by translating the hardware key number to the actual key in the current layout on the program start-up.</p> <p>I can give the actual key to pyqt then, or any other toolkit, which does not need to know anything then.</p> <p>The key left of the one-key has the the key number "1" sometimes (see <a href="http://pic.dhe.ibm.com/infocenter/aix/v7r1/index.jsp?topic=%2Fcom.ibm.aix.keyboardtechref%2Fdoc%2Fkybdtech%2FKey.htm" rel="nofollow">http://pic.dhe.ibm.com/infocenter/aix/v7r1/index.jsp?topic=%2Fcom.ibm.aix.keyboardtechref%2Fdoc%2Fkybdtech%2FKey.htm</a> ).</p> <p>If I intercept this key in qt and print out its "nativeScanCode" I get "49" as result. </p> <p>So all in all I would prefer a python only solution, but Qt dependent is also fine.</p> <p>Reason: The reason is that this is a very comfortable key to use (regarding the layout) but highly language dependent. In some keyboard-languages it is even a 'dead key' which requires a second key to create a char with diacritic.</p> <p>If you want to test it yourself just take the z and the y keys with qwerty and qwertz, that is the simpler example than the key left of the one, but in principle it is the same problem. The goal is a shortcut that is always triggered by the key in the lower left corner of the keyboard, no matter if qwertz or qwerty (as the name suggest, the difference between these two is that z and y are reversed)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload