hellosystem / qkeysequenceoverride Goto Github PK
View Code? Open in Web Editor NEWOverride the QKeySequence::toString() function in Qt to represent keyboard shortcuts with graphical symbols
Override the QKeySequence::toString() function in Qt to represent keyboard shortcuts with graphical symbols
Does not build, fatal error: 'QKeySequence' file not found
. build.sh
hardcodes BSDism /usr/local/
, should be fixed.
Even with editing this, it has the same error.
Tested on Raspberry Pi OS.
Note: I had only Qt 5 installed, maybe I also need Qt 6.
unsetting LD_LIBRARY_PATH
before launching LibreOffice (but not Menu) gives the intended result:
Possibly the same root cause as #5?
static const MacSpecialKey entries[NumEntries] = {
{ Qt::Key_Escape, 0x238B },
{ Qt::Key_Tab, 0x21E5 },
{ Qt::Key_Backtab, 0x21E4 },
{ Qt::Key_Backspace, 0x232B },
{ Qt::Key_Return, 0x21B5 },
{ Qt::Key_Enter, 0x2324 },
{ Qt::Key_Delete, 0x2326 },
{ Qt::Key_Home, 0x2196 },
{ Qt::Key_End, 0x2198 },
{ Qt::Key_Left, 0x2190 },
{ Qt::Key_Up, 0x2191 },
{ Qt::Key_Right, 0x2192 },
{ Qt::Key_Down, 0x2193 },
{ Qt::Key_PageUp, 0x21DE },
{ Qt::Key_PageDown, 0x21DF },
{ Qt::Key_Shift, kShiftUnicode },
{ Qt::Key_Control, kCommandUnicode },
{ Qt::Key_Meta, kControlUnicode },
{ Qt::Key_Alt, kOptionUnicode },
{ Qt::Key_CapsLock, 0x21EA },
};
Preloading this leads to Qt5 being loaded in addition to Qt6, which leads to
% qtcreator
zsh: segmentation fault qtcreator
We need to find a way to change QKeySequence::toString()
without using LD_PRELOAD
. Is the only way to recompile (parts of) Qt?
Looks like QTerminal really doesn't play well with QKeySequenceOverride in place.
Running it causes its config file to be rewritten automatically like this:
sudo env PAGER=cat pkg.real update && sudo env PAGER=cat pkg.real upgrade
(...)
[Shortcuts]
Add%20Tab=\x2318\x21e7T
Bottom%20Subterminal=\x2325\x2193
Clear%20Active%20Terminal=\x2318\x21e7X
Close%20Tab=\x2318\x21e7W
Collapse%20Subterminal=
Copy%20Selection=\x2318\x21e7\x43
Find=\x2318\x21e7\x46
Fullscreen=F11
Handle%20history=
Hide%20Window%20Borders=
Left%20Subterminal=\x2325\x2190
Move%20Tab%20Left=\x2325\x21e7\x2190|\x2318\x21e7Pg\x2191
Move%20Tab%20Right=\x2325\x21e7\x2192|\x2318\x21e7Pg\x2193
New%20Window=\x2318\x21e7N
Next%20Tab=\x2318Pg\x2193
Next%20Tab%20in%20History=\x2318\x21e7\x21e5
Paste%20Clipboard=\x2318\x21e7V
Paste%20Selection=\x21e7Ins
Preferences...=
Previous%20Tab=\x2318Pg\x2191
Previous%20Tab%20in%20History=\x2318\x21e5
Quit=\x2318Q
Rename%20Session=\x2325\x21e7S
Right%20Subterminal=\x2325\x2192
Show%20Tab%20Bar=
Split%20Terminal%20Horizontally=
Split%20Terminal%20Vertically=
Tab%201=
Tab%2010=
Tab%202=
Tab%203=
Tab%204=
Tab%205=
Tab%206=
Tab%207=
Tab%208=
Tab%209=
Toggle%20Bookmarks=\x2318\x21e7\x42
Toggle%20Menu=\x2318\x21e7M
Top%20Subterminal=\x2325\x2191
Zoom%20in=\x2318+
Zoom%20out=\x2318-
Zoom%20reset=\x2318\x30
Apparently QTerminal is making the assumption that what gets returened by QKeySequence::toString()
is in a certain format.
Since @antony-jr has been injecting menu items using Qt plugins rather than LD_PRELOAD
I wonder if it would be possible to do what this repo does but as a Qt plugin. Would feel a bit cleaner to me, although the current solution appears to work fine.
Was considering showing "Alt" instead of "Command" for PC keyboards, but wasn't sure whether it would further complicate things (think screenshots and documentation).
Now it has been asked on Twitter:
https://twitter.com/mister_lemke/status/1449008251622748163
Let's think about the best way to go about this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.