Skip to content

Commit a030701

Browse files
authored
Merge pull request #950 from o-sdn-o/gui-bridge
Implement Abstract Latin Layout, ALL (+KKP support)
2 parents 6bb91bb + 89f1151 commit a030701

13 files changed

Lines changed: 1214 additions & 985 deletions

doc/application_defined_reporting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Overview
66

7-
Application Defined Reporting (ADR) is a paradigm shift in terminal-to-application communication. Instead of relying on hardcoded keyboard or mouse protocols (like xterm, kitty, or win32-input-mode), ADR allows the application to dynamically define its own event-reporting logic. This is achieved by deploying a lightweight, isolated execution environment (Lua sandbox) on the terminal side.
7+
Application Defined Reporting (ADR) is a paradigm shift in terminal-to-application communication. Instead of relying on hardcoded keyboard or mouse protocols (like xterm, kkp, or win32-input-mode), ADR allows the application to dynamically define its own event-reporting logic. This is achieved by deploying a lightweight, isolated execution environment (Lua sandbox) on the terminal side.
88

99
## Architecture
1010

doc/settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ Type | Example |Description
462462
Notes:
463463
- Generic, literal and specific key sequences can be mixed in any order within a key chord list.
464464
- The required key combination sequence can be generated on the Info page, by clicking the label in the lower right corner of the vtm desktop.
465-
- "Literal" key combinations automatically filter out keyboard shift modifiers such as Shift/AltGr/IsoLevel5Shift.
465+
- "Literal" key combinations automatically filter out keyboard shift modifiers such as Shift/AltGr/Level5Shift.
466466

467467
#### Mouse events
468468

doc/vt-input-mode.md

Lines changed: 301 additions & 299 deletions
Large diffs are not rendered by default.

src/netxs/apps.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -800,13 +800,7 @@ namespace netxs::app::shared
800800
auto& luafx = boss.bell::indexer.luafx;
801801
app::shared::base_kb_navigation(config, scroll, boss);
802802
input::bindings::keybind(boss, "Any", "vtm.infopage.UpdateChordPreview()");
803-
input::bindings::keybind(boss,
804-
#if defined(_WIN32)
805-
"preview:Ctrl-Alt | Alt-Ctrl",
806-
#else
807-
"preview:Alt+Shift+B",
808-
#endif
809-
"vtm.infopage.ExclusiveKeyboardMode()");
803+
input::bindings::keybind(boss, "preview:Ctrl-Alt | Alt-Ctrl", "vtm.infopage.ExclusiveKeyboardMode()");
810804
boss.base::add_methods(basename::infopage,
811805
{
812806
{ "UpdateChordPreview", [&]

src/netxs/desktopio/ansivt.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ namespace netxs::ansi
8686
static const auto csi_dsr = 'n'; // CSI n n — Device Status Report (DSR). n==5 -> "OK"; n==6 -> CSI r ; c R
8787
static const auto csi_scp = 's'; // CSI s — Save cursor Position.
8888
static const auto csi_rcp = 'u'; // CSI u — Restore cursor Position.
89-
static const auto csi_qst_kkp = 'u'; // CSI ? u — KKP.
89+
static const auto csi_qst_kkp = 'u'; // CSI ? u — Request current KKP mode.
90+
static const auto csi__eq_kkp = 'u'; // CSI = [n[;m]] u — Update current KKP mode to n. Update mode m: 1(default) - SET(n); 2 - ADD(n); 3 - CLEAR(n)
91+
static const auto csi__gt_kkp = 'u'; // CSI > [n] u — Push KKP mode n(0) to the stack.
92+
static const auto csi__lt_kkp = 'u'; // CSI < [n] u — Pop n(1) KKP modes from stack.
9093
static const auto csi__el = 'K'; // CSI n K — Erase 0: from cursor to end, 1: from begin to cursor, 2: all line.
9194
static const auto csi__il = 'L'; // CSI n L — Insert n blank lines.
9295
static const auto csi__ed = 'J'; // CSI n J — Erase 0: from cursor to end of screen, 1: from begin to cursor, 2: all screen.

src/netxs/desktopio/application.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace netxs::app
2222

2323
namespace netxs::app::shared
2424
{
25-
static const auto version = "v2026.06.29";
25+
static const auto version = "v2026.07.05";
2626
static const auto repository = "https://github.com/directvt/vtm";
2727
static const auto usr_config = "~/.config/vtm/settings.xml"s;
2828
static const auto sys_config = "/etc/vtm/settings.xml"s;

src/netxs/desktopio/consrv.hpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,10 +1104,10 @@ struct impl : consrv
11041104
if (toWIDE.empty()) toWIDE.push_back(0);
11051105
auto c = toWIDE.front();
11061106

1107-
auto altgr_pressed = input::key::kmap::pressed(gear, input::key::AltGr);
1107+
//auto altgr_pressed = input::key::kmap::pressed(gear, input::key::AltGr);
11081108
auto ctrls = os::nt::ms_kbstate(gear.ctlstat)
1109-
| (gear.extflag ? ENHANCED_KEY : 0)
1110-
| (altgr_pressed ? LEFT_CTRL_PRESSED | RIGHT_ALT_PRESSED : 0);
1109+
| (gear.extflag ? ENHANCED_KEY : 0);
1110+
//| (altgr_pressed ? LEFT_CTRL_PRESSED | RIGHT_ALT_PRESSED : 0);
11111111
if (toWIDE.size() > 1) // Surrogate pair special case (not a clipboard paste, see generate(wiew wstr, ui32 s = 0)).
11121112
{
11131113
if (gear.keystat)
@@ -1123,19 +1123,20 @@ struct impl : consrv
11231123
{
11241124
if (server.inpmod & nt::console::inmode::vt)
11251125
{
1126-
auto yield = gear.interpret(decckm);
1126+
auto yield = input::key::interpret(gear, decckm);
11271127
if (yield.size()) generate(yield);
11281128
}
11291129
else
11301130
{
1131-
if (gear.keycode == input::key::AltGr) // Generate fake LeftCtrl events on AltGr activity.
1132-
{
1133-
auto lctrl = input::key::map::data(input::key::LeftCtrl);
1134-
auto pre_ctrls = ctrls;
1135-
if (gear.keystat == input::key::pressed) pre_ctrls = (pre_ctrls & ~(ENHANCED_KEY | RIGHT_ALT_PRESSED)) | LEFT_CTRL_PRESSED; // AltGr is not pressed yet.
1136-
else pre_ctrls = (pre_ctrls & ~(ENHANCED_KEY )) | RIGHT_ALT_PRESSED; // AltGr is still pressed.
1137-
generate(c, pre_ctrls, lctrl.vkey, gear.keystat, lctrl.scan); // Restore the LeftCtrl+RightAlt state for AltGr.
1138-
}
1131+
// We don't simulate win32's AltGr behavior.
1132+
//if (gear.keycode == input::key::AltGr) // Generate fake LeftCtrl events on AltGr activity.
1133+
//{
1134+
// auto lctrl = input::key::map::data(input::key::LeftCtrl);
1135+
// auto pre_ctrls = ctrls;
1136+
// if (gear.keystat == input::key::pressed) pre_ctrls = (pre_ctrls & ~(ENHANCED_KEY | RIGHT_ALT_PRESSED)) | LEFT_CTRL_PRESSED; // AltGr is not pressed yet.
1137+
// else pre_ctrls = (pre_ctrls & ~(ENHANCED_KEY )) | RIGHT_ALT_PRESSED; // AltGr is still pressed.
1138+
// generate(c, pre_ctrls, lctrl.vkey, gear.keystat, lctrl.scan); // Restore the LeftCtrl+RightAlt state for AltGr.
1139+
//}
11391140
generate(c, ctrls, gear.virtcod, gear.keystat, gear.scancod);
11401141
}
11411142
}
@@ -2705,7 +2706,7 @@ struct impl : consrv
27052706
}
27062707
auto api_process_create_handle ()
27072708
{
2708-
log(prompt, "Create console handle");
2709+
log(prompt, "Create console handle (CreateConsoleScreenBuffer)");
27092710
enum type : ui32
27102711
{
27112712
undefined,

0 commit comments

Comments
 (0)