Friendly signature for a bare (non-chord) key event. Used both as AppSettings binding key and as a label in the Learn-mode UI.
| 40 | // Friendly signature for a bare (non-chord) key event. Used both as |
| 41 | // AppSettings binding key and as a label in the Learn-mode UI. |
| 42 | QString bareKeySignature(int keycode) |
| 43 | { |
| 44 | switch (keycode) { |
| 45 | case KEY_PLAYPAUSE: return QStringLiteral("KEY_PLAYPAUSE"); |
| 46 | case KEY_MUTE: return QStringLiteral("KEY_MUTE"); |
| 47 | case KEY_PREVIOUSSONG: return QStringLiteral("KEY_PREVIOUSSONG"); |
| 48 | case KEY_NEXTSONG: return QStringLiteral("KEY_NEXTSONG"); |
| 49 | default: |
| 50 | return QStringLiteral("KEY_%1").arg(keycode); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | // Read an input device's name from sysfs (e.g. "Ulanzi Dial Keyboard"). The |
| 55 | // sysfs `name` attribute is world-readable, so this works even when we lack |