Fix Broken Tilde and Grave (Backtick/Backquote)

This commit is contained in:
Dennis Gentry 2022-07-06 16:16:37 -07:00
parent 653e4badeb
commit ed373612b7
4 changed files with 27 additions and 26 deletions

View File

@ -0,0 +1,3 @@
Fix the regression introduced in #1214 that caused tilde (~) and grave
(`) to stop being sendable from at least a MacOS Barrier Server (and
probably others). Fixes Issues #1541 and #1407

View File

@ -91,19 +91,19 @@ void Screen::saveSettings(QSettings& settings) const
QTextStream& Screen::writeScreensSection(QTextStream& outStream) const QTextStream& Screen::writeScreensSection(QTextStream& outStream) const
{ {
outStream << "\t" << name() << ":" << endl; outStream << "\t" << name() << ":" << Qt::endl;
for (int i = 0; i < modifiers().size(); i++) { for (int i = 0; i < modifiers().size(); i++) {
auto mod = static_cast<Modifier>(i); auto mod = static_cast<Modifier>(i);
if (modifier(mod) != mod) { if (modifier(mod) != mod) {
outStream << "\t\t" << modifierName(mod) << " = " << modifierName(modifier(mod)) outStream << "\t\t" << modifierName(mod) << " = " << modifierName(modifier(mod))
<< endl; << Qt::endl;
} }
} }
for (int i = 0; i < fixes().size(); i++) { for (int i = 0; i < fixes().size(); i++) {
auto fix = static_cast<Fix>(i); auto fix = static_cast<Fix>(i);
outStream << "\t\t" << fixName(fix) << " = " << (fixes()[i] ? "true" : "false") << endl; outStream << "\t\t" << fixName(fix) << " = " << (fixes()[i] ? "true" : "false") << Qt::endl;
} }
outStream << "\t\t" << "switchCorners = none "; outStream << "\t\t" << "switchCorners = none ";
@ -112,9 +112,9 @@ QTextStream& Screen::writeScreensSection(QTextStream& outStream) const
outStream << "+" << switchCornerName(static_cast<SwitchCorner>(i)) << " "; outStream << "+" << switchCornerName(static_cast<SwitchCorner>(i)) << " ";
} }
} }
outStream << endl; outStream << Qt::endl;
outStream << "\t\t" << "switchCornerSize = " << switchCornerSize() << endl; outStream << "\t\t" << "switchCornerSize = " << switchCornerSize() << Qt::endl;
return outStream; return outStream;
} }

View File

@ -210,56 +210,56 @@ int ServerConfig::adjacentScreenIndex(int idx, int deltaColumn, int deltaRow) co
QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config) QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config)
{ {
outStream << "section: screens" << endl; outStream << "section: screens" << Qt::endl;
for (const Screen& s : config.screens()) { for (const Screen& s : config.screens()) {
if (!s.isNull()) if (!s.isNull())
s.writeScreensSection(outStream); s.writeScreensSection(outStream);
} }
outStream << "end" << endl << endl; outStream << "end" << Qt::endl << Qt::endl;
outStream << "section: aliases" << endl; outStream << "section: aliases" << Qt::endl;
for (const Screen& s : config.screens()) { for (const Screen& s : config.screens()) {
if (!s.isNull()) if (!s.isNull())
s.writeAliasesSection(outStream); s.writeAliasesSection(outStream);
} }
outStream << "end" << endl << endl; outStream << "end" << Qt::endl << Qt::endl;
outStream << "section: links" << endl; outStream << "section: links" << Qt::endl;
for (int i = 0; i < config.screens().size(); i++) for (int i = 0; i < config.screens().size(); i++)
if (!config.screens()[i].isNull()) if (!config.screens()[i].isNull())
{ {
outStream << "\t" << config.screens()[i].name() << ":" << endl; outStream << "\t" << config.screens()[i].name() << ":" << Qt::endl;
for (unsigned int j = 0; j < sizeof(neighbourDirs) / sizeof(neighbourDirs[0]); j++) for (unsigned int j = 0; j < sizeof(neighbourDirs) / sizeof(neighbourDirs[0]); j++)
{ {
int idx = config.adjacentScreenIndex(i, neighbourDirs[j].x, neighbourDirs[j].y); int idx = config.adjacentScreenIndex(i, neighbourDirs[j].x, neighbourDirs[j].y);
if (idx != -1 && !config.screens()[idx].isNull()) if (idx != -1 && !config.screens()[idx].isNull())
outStream << "\t\t" << neighbourDirs[j].name << " = " << config.screens()[idx].name() << endl; outStream << "\t\t" << neighbourDirs[j].name << " = " << config.screens()[idx].name() << Qt::endl;
} }
} }
outStream << "end" << endl << endl; outStream << "end" << Qt::endl << Qt::endl;
outStream << "section: options" << endl; outStream << "section: options" << Qt::endl;
if (config.hasHeartbeat()) if (config.hasHeartbeat())
outStream << "\t" << "heartbeat = " << config.heartbeat() << endl; outStream << "\t" << "heartbeat = " << config.heartbeat() << Qt::endl;
outStream << "\t" << "relativeMouseMoves = " << (config.relativeMouseMoves() ? "true" : "false") << endl; outStream << "\t" << "relativeMouseMoves = " << (config.relativeMouseMoves() ? "true" : "false") << Qt::endl;
outStream << "\t" << "screenSaverSync = " << (config.screenSaverSync() ? "true" : "false") << endl; outStream << "\t" << "screenSaverSync = " << (config.screenSaverSync() ? "true" : "false") << Qt::endl;
outStream << "\t" << "win32KeepForeground = " << (config.win32KeepForeground() ? "true" : "false") << endl; outStream << "\t" << "win32KeepForeground = " << (config.win32KeepForeground() ? "true" : "false") << Qt::endl;
outStream << "\t" << "clipboardSharing = " << (config.clipboardSharing() ? "true" : "false") << endl; outStream << "\t" << "clipboardSharing = " << (config.clipboardSharing() ? "true" : "false") << Qt::endl;
if (config.hasSwitchDelay()) if (config.hasSwitchDelay())
outStream << "\t" << "switchDelay = " << config.switchDelay() << endl; outStream << "\t" << "switchDelay = " << config.switchDelay() << Qt::endl;
if (config.hasSwitchDoubleTap()) if (config.hasSwitchDoubleTap())
outStream << "\t" << "switchDoubleTap = " << config.switchDoubleTap() << endl; outStream << "\t" << "switchDoubleTap = " << config.switchDoubleTap() << Qt::endl;
outStream << "\t" << "switchCorners = none "; outStream << "\t" << "switchCorners = none ";
for (int i = 0; i < config.switchCorners().size(); i++) { for (int i = 0; i < config.switchCorners().size(); i++) {
@ -268,15 +268,15 @@ QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config)
outStream << "+" << config.switchCornerName(corner) << " "; outStream << "+" << config.switchCornerName(corner) << " ";
} }
} }
outStream << endl; outStream << Qt::endl;
outStream << "\t" << "switchCornerSize = " << config.switchCornerSize() << endl; outStream << "\t" << "switchCornerSize = " << config.switchCornerSize() << Qt::endl;
for (const Hotkey& hotkey : config.hotkeys()) { for (const Hotkey& hotkey : config.hotkeys()) {
outStream << hotkey; outStream << hotkey;
} }
outStream << "end" << endl << endl; outStream << "end" << Qt::endl << Qt::endl;
return outStream; return outStream;
} }

View File

@ -131,8 +131,6 @@ static const KeyEntry s_controlKeys[] = {
{ kKeyEisuToggle, kVK_JIS_Eisu }, { kKeyEisuToggle, kVK_JIS_Eisu },
{ kKeyKana, kVK_JIS_Kana }, { kKeyKana, kVK_JIS_Kana },
{ kKeyMuhenkan, s_int5VK }, { kKeyMuhenkan, s_int5VK },
{ kKeyHenkan, s_int4VK },
{ kKeyZenkaku, kVK_ANSI_Grave }
}; };