Various cleanups.
- Update input handling to retain SDL_TEXTINPUT after Tab insertion for better platform consistency. - Allow multiple app instances in macOS by modifying `Info.plist`. - Bump version to 1.3.8-alpha.
This commit is contained in:
@@ -4,7 +4,7 @@ project(kte)
|
|||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(KTE_VERSION "1.3.7")
|
set(KTE_VERSION "1.3.8-alpha")
|
||||||
|
|
||||||
# Default to terminal-only build to avoid SDL/OpenGL dependency by default.
|
# Default to terminal-only build to avoid SDL/OpenGL dependency by default.
|
||||||
# Enable with -DBUILD_GUI=ON when SDL2/OpenGL/Freetype are available.
|
# Enable with -DBUILD_GUI=ON when SDL2/OpenGL/Freetype are available.
|
||||||
|
|||||||
@@ -345,7 +345,9 @@ GUIInputHandler::ProcessSDLEvent(const SDL_Event &e)
|
|||||||
segment = std::string_view(text).substr(start);
|
segment = std::string_view(text).substr(start);
|
||||||
}
|
}
|
||||||
if (!segment.empty()) {
|
if (!segment.empty()) {
|
||||||
MappedInput ins{true, CommandId::InsertText, std::string(segment), 0};
|
MappedInput ins{
|
||||||
|
true, CommandId::InsertText, std::string(segment), 0
|
||||||
|
};
|
||||||
q_.push(ins);
|
q_.push(ins);
|
||||||
}
|
}
|
||||||
if (has_nl) {
|
if (has_nl) {
|
||||||
@@ -364,15 +366,14 @@ GUIInputHandler::ProcessSDLEvent(const SDL_Event &e)
|
|||||||
|
|
||||||
produced = map_key(key, mods,
|
produced = map_key(key, mods,
|
||||||
k_prefix_, esc_meta_,
|
k_prefix_, esc_meta_,
|
||||||
uarg_active_, uarg_collecting_, uarg_negative_, uarg_had_digits_, uarg_value_,
|
uarg_active_, uarg_collecting_, uarg_negative_, uarg_had_digits_,
|
||||||
|
uarg_value_,
|
||||||
uarg_text_,
|
uarg_text_,
|
||||||
mi);
|
mi);
|
||||||
|
|
||||||
// If we inserted a TAB on KEYDOWN, suppress any subsequent SDL_TEXTINPUT
|
// Note: Do NOT suppress SDL_TEXTINPUT after inserting a TAB. Most platforms
|
||||||
// for this keystroke to avoid double insertion on platforms that emit it.
|
// do not emit TEXTINPUT for Tab, and suppressing here would incorrectly
|
||||||
if (produced && mi.hasCommand && mi.id == CommandId::InsertText && mi.arg == "\t") {
|
// eat the next character typed if no TEXTINPUT follows the Tab press.
|
||||||
suppress_text_input_once_ = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we just consumed a universal-argument digit or '-' on KEYDOWN and emitted UArgStatus,
|
// If we just consumed a universal-argument digit or '-' on KEYDOWN and emitted UArgStatus,
|
||||||
// suppress the subsequent SDL_TEXTINPUT for this keystroke to avoid duplicating the digit in status.
|
// suppress the subsequent SDL_TEXTINPUT for this keystroke to avoid duplicating the digit in status.
|
||||||
@@ -404,7 +405,8 @@ GUIInputHandler::ProcessSDLEvent(const SDL_Event &e)
|
|||||||
}
|
}
|
||||||
// Alt/Meta + letter can also generate TEXTINPUT on some platforms
|
// Alt/Meta + letter can also generate TEXTINPUT on some platforms
|
||||||
const bool is_meta_symbol = (
|
const bool is_meta_symbol = (
|
||||||
key == SDLK_COMMA || key == SDLK_PERIOD || key == SDLK_LESS || key == SDLK_GREATER);
|
key == SDLK_COMMA || key == SDLK_PERIOD || key == SDLK_LESS || key ==
|
||||||
|
SDLK_GREATER);
|
||||||
if (is_alt && ((key >= SDLK_a && key <= SDLK_z) || is_meta_symbol)) {
|
if (is_alt && ((key >= SDLK_a && key <= SDLK_z) || is_meta_symbol)) {
|
||||||
should_suppress = true;
|
should_suppress = true;
|
||||||
}
|
}
|
||||||
@@ -574,6 +576,8 @@ GUIInputHandler::ProcessSDLEvent(const SDL_Event &e)
|
|||||||
// Attach universal-argument count if present, then clear the state
|
// Attach universal-argument count if present, then clear the state
|
||||||
if (uarg_active_ &&mi
|
if (uarg_active_ &&mi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.
|
.
|
||||||
id != CommandId::UArgStatus
|
id != CommandId::UArgStatus
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -24,5 +24,8 @@
|
|||||||
<string>10.13</string>
|
<string>10.13</string>
|
||||||
<key>NSHighResolutionCapable</key>
|
<key>NSHighResolutionCapable</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<!-- Allow running multiple instances of the app -->
|
||||||
|
<key>LSMultipleInstancesProhibited</key>
|
||||||
|
<false/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
Reference in New Issue
Block a user