From 3453ae80e3c638ac27261b0b758454eba0e1f666 Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Sat, 9 Nov 2024 21:59:39 +0500 Subject: [PATCH 01/12] #86 WIP: Rename generic keys to make it more generic --- src/netxs/apps/tile.hpp | 2 +- src/netxs/desktopio/ansivt.hpp | 8 +- src/netxs/desktopio/console.hpp | 43 ++-- src/netxs/desktopio/controls.hpp | 1 + src/netxs/desktopio/input.hpp | 326 ++++++++++++++++--------------- src/netxs/desktopio/richtext.hpp | 12 +- src/netxs/desktopio/terminal.hpp | 17 -- src/vtm.xml | 4 +- 8 files changed, 209 insertions(+), 204 deletions(-) diff --git a/src/netxs/apps/tile.hpp b/src/netxs/apps/tile.hpp index 922f72e458..b973fcf8a5 100644 --- a/src/netxs/apps/tile.hpp +++ b/src/netxs/apps/tile.hpp @@ -141,7 +141,7 @@ namespace netxs::app::tile client->clear(); depth = 0; boss.diveup([&]{ depth++; }); - if constexpr (debugmode) log(prompt::tile, "Start depth %%", depth); + if constexpr (debugmode) log("%%Start depth %%", prompt::tile, depth); }; } }; diff --git a/src/netxs/desktopio/ansivt.hpp b/src/netxs/desktopio/ansivt.hpp index baf0e413da..f01943d17d 100644 --- a/src/netxs/desktopio/ansivt.hpp +++ b/src/netxs/desktopio/ansivt.hpp @@ -1730,11 +1730,15 @@ namespace netxs::ansi data(n * wdt, proto_cells); proto_cells.clear(); } + template void reset(cell c = {}) { brush.reset(c); - style.rst(); - state.rst(); + if constexpr (ResetStyle) + { + style.rst(); + state.rst(); + } proto_count = 0; proto_cells.clear(); } diff --git a/src/netxs/desktopio/console.hpp b/src/netxs/desktopio/console.hpp index 54638b7761..9a40f6218b 100644 --- a/src/netxs/desktopio/console.hpp +++ b/src/netxs/desktopio/console.hpp @@ -150,11 +150,13 @@ namespace netxs::ui auto& focus = lock.thing; auto deed = netxs::events::makeid(hids::events::keybd::focus::bus::any.id, focus.cause); if (focus.guid != ui::console::id.second || deed != hids::events::keybd::focus::bus::copy.id) // To avoid focus tree infinite looping. - owner.bell::enqueue(owner.This(), [d = focus, deed](auto& boss) mutable { - auto seed = hids::events::keybd::focus::bus::on.param({ .id = d.gear_id }); - boss.bell::signal(tier::release, deed, seed); - }); + owner.bell::enqueue(owner.This(), [d = focus, deed](auto& boss) mutable + { + auto seed = hids::events::keybd::focus::bus::on.param({ .id = d.gear_id }); + boss.bell::signal(tier::release, deed, seed); + }); + } } void handle(s11n::xs::req_input_fields lock) { @@ -622,7 +624,7 @@ namespace netxs::ui X(win_size , "win size" ) \ X(key_code , "key virt" ) \ X(key_scancode , "key scan" ) \ - X(key_character, "key data" ) \ + X(key_chord , "key chord" ) \ X(key_state , "key state" ) \ X(key_payload , "key type" ) \ X(ctrl_state , "controls" ) \ @@ -742,7 +744,7 @@ namespace netxs::ui stress = cell{}.fgc(whitelt); alerts = cell{}.fgc(argb{ 0xFF'ff'd0'd0 }); - status.style.wrp(wrap::on).jet(bias::left).rlf(feed::rev).mgl(4); + status.style.wrp(wrap::off).jet(bias::left).rlf(feed::rev).mgl(4); status.current().locus.cup(dot_00).cnl(2); auto maxlen = 0_sz; @@ -815,17 +817,32 @@ namespace netxs::ui : k.payload == keybd::type::imeanons ? "IME composition" : k.payload == keybd::type::imeinput ? "IME input" : k.payload == keybd::type::kblayout ? "keyboard layout" : "unknown payload"; - if (k.cluster.length()) + if (k.vkchord.length()) { auto t = text{}; - for (byte c : k.cluster) + if (k.vkchord.size() && k.keystat != input::key::repeated) { - if (c < 0x20) t += "^" + utf::to_utf_from_code(c + 0x40); - else if (c == 0x7F) t += "\\x7F"; - else if (c == 0x20) t += "\\x20"; - else t.push_back(c); + auto vkchord = input::key::kmap::to_string(k.vkchord, faux); + auto scchord = input::key::kmap::to_string(k.scchord, faux); + auto chchord = input::key::kmap::to_string(k.chchord, faux); + auto gen_vkchord = input::key::kmap::to_string(k.vkchord, true); + auto gen_chchord = input::key::kmap::to_string(k.chchord, true); + //log("Keyboard chords: %% %% %%", utf::buffer_to_hex(gear.vkchord), utf::buffer_to_hex(gear.scchord), utf::buffer_to_hex(gear.chchord), + if (vkchord.size()) t += (t.size() ? " " : "") + (vkchord == gen_vkchord ? vkchord : gen_vkchord + " " + vkchord); + if (chchord.size()) t += (t.size() ? " " : "") + (chchord == gen_chchord ? chchord : gen_chchord + " " + chchord); + if (scchord.size()) t += (t.size() ? " " : "") + scchord; + } + else if (k.cluster.length()) //todo revise + { + for (byte c : k.cluster) + { + if (c < 0x20) t += "^" + utf::to_utf_from_code(c + 0x40); + else if (c == 0x7F) t += "\\x7F"; + else if (c == 0x20) t += "\\x20"; + else t.push_back(c); + } } - status[prop::key_character].set(stress) = t; + if (t.size()) status[prop::key_chord].set(stress) = t; } }; boss.LISTEN(tier::release, e2::conio::error, error, tokens) diff --git a/src/netxs/desktopio/controls.hpp b/src/netxs/desktopio/controls.hpp index 579661bbf5..d46c836832 100644 --- a/src/netxs/desktopio/controls.hpp +++ b/src/netxs/desktopio/controls.hpp @@ -1656,6 +1656,7 @@ namespace netxs::ui }); } }; + //todo should we replace it with base::riseup(forced)? // pro::mouse: Propagate form events down to the visual branch. Executed last. boss.LISTEN(tier::release, hids::events::notify::any, gear) { diff --git a/src/netxs/desktopio/input.hpp b/src/netxs/desktopio/input.hpp index 75eb855151..b602e10b28 100644 --- a/src/netxs/desktopio/input.hpp +++ b/src/netxs/desktopio/input.hpp @@ -334,162 +334,162 @@ namespace netxs::input //todo check non-us kb layouts with key::Slash #define key_list \ - /*Id Index Vkey Scan CtrlState Mask I Name GenericName */\ - X(0, 0, 0, 0, 0, 0x0000'00'FF, 1, undef , undef )\ - X(1, 0, 0xFF, 0xFF, 0, 0x0000'FF'FF, 0, config , config )\ - X(2, 0xA2, 0x11, 0x1D, 0, 0x0100'00'FF, 0, LeftCtrl , Ctrl )\ - X(3, 0xA3, 0x11, 0x1D, ExtendedKey, 0x0100'00'FF, 0, RightCtrl , Ctrl )\ - X(4, 0xA4, 0x12, 0x38, 0, 0x0100'00'FF, 0, LeftAlt , Alt )\ - X(5, 0xA5, 0x12, 0x38, ExtendedKey, 0x0100'00'FF, 0, RightAlt , Alt )\ - X(6, 0xA0, 0x10, 0x2A, 0, 0x0000'FF'FF, 0, LeftShift , Shift )\ - X(7, 0xA1, 0x10, 0x36, 0, 0x0000'FF'FF, 0, RightShift , Shift )\ - X(8, 0x5B, 0x5B, 0x5B, ExtendedKey, 0x0000'00'FF, 0, LeftWin , Win )\ - X(9, 0x5C, 0x5C, 0x5C, ExtendedKey, 0x0000'00'FF, 0, RightWin , Win )\ - X(10, 0x5D, 0x5D, 0x5D, ExtendedKey, 0x0000'00'FF, 0, Apps , Apps )\ - X(12, 0x90, 0x90, 0x45, 0, 0x0000'00'FF, 0, NumLock , NumLock )\ - X(14, 0x14, 0x14, 0x3A, 0, 0x0000'00'FF, 0, CapsLock , CapsLock )\ - X(16, 0x91, 0x91, 0x45, 0, 0x0000'00'FF, 0, ScrollLock , ScrollLock )\ - X(18, 0x1B, 0x1B, 0x01, 0, 0x0000'00'FF, 1, Esc , Esc )\ - X(20, 0x20, 0x20, 0x39, 0, 0x0000'00'FF, 1, Space , Space )\ - X(22, 0x08, 0x08, 0x0E, 0, 0x0000'00'FF, 1, Backspace , Backspace )\ - X(24, 0x09, 0x09, 0x0F, 0, 0x0000'00'FF, 1, Tab , Tab )\ - X(26, 0x03, 0x03, 0x46, 0, 0x0000'FF'FF, 1, Break , Break )\ - X(28, 0x13, 0x13, 0x45, 0, 0x0000'FF'FF, 0, Pause , Pause )\ - X(30, 0x29, 0x29, 0, 0, 0x0000'00'FF, 0, Select , Select )\ - X(32, 0x2C, 0x2C, 0x54, 0, 0x0000'FF'FF, 1, SysRq , SysRq )\ - X(34, 0x2C, 0x2C, 0x37, ExtendedKey, 0x0100'FF'FF, 0, PrintScreen , PrintScreen )\ - X(36, 0x0D, 0x0D, 0x1C, 0, 0x0100'00'FF, 1, KeyEnter , Enter )\ - X(37, 0x0D, 0x0D, 0x1C, ExtendedKey, 0x0100'00'FF, 1, NumpadEnter , Enter )\ - X(38, 0x21, 0x21, 0x49, ExtendedKey, 0x0100'00'FF, 1, KeyPageUp , PageUp )\ - X(39, 0x21, 0x21, 0x49, 0, 0x0100'00'FF, 1, NumpadPageUp , PageUp )\ - X(40, 0x22, 0x22, 0x51, ExtendedKey, 0x0100'00'FF, 1, KeyPageDown , PageDown )\ - X(41, 0x22, 0x22, 0x51, 0, 0x0100'00'FF, 1, NumpadPageDown , PageDown )\ - X(42, 0x23, 0x23, 0x4F, ExtendedKey, 0x0100'00'FF, 1, KeyEnd , End )\ - X(43, 0x23, 0x23, 0x4F, 0, 0x0100'00'FF, 1, NumpadEnd , End )\ - X(44, 0x24, 0x24, 0x47, ExtendedKey, 0x0100'00'FF, 1, KeyHome , Home )\ - X(45, 0x24, 0x24, 0x47, 0, 0x0100'00'FF, 1, NumpadHome , Home )\ - X(46, 0x25, 0x25, 0x4B, ExtendedKey, 0x0100'00'FF, 1, KeyLeftArrow , LeftArrow )\ - X(47, 0x25, 0x25, 0x4B, 0, 0x0100'00'FF, 1, NumpadLeftArrow , LeftArrow )\ - X(48, 0x26, 0x26, 0x48, ExtendedKey, 0x0100'00'FF, 1, KeyUpArrow , UpArrow )\ - X(49, 0x26, 0x26, 0x48, 0, 0x0100'00'FF, 1, NumpadUpArrow , UpArrow )\ - X(50, 0x27, 0x27, 0x4D, ExtendedKey, 0x0100'00'FF, 1, KeyRightArrow , RightArrow )\ - X(51, 0x27, 0x27, 0x4D, 0, 0x0100'00'FF, 1, NumpadRightArrow, RightArrow )\ - X(52, 0x28, 0x28, 0x50, ExtendedKey, 0x0100'00'FF, 1, KeyDownArrow , DownArrow )\ - X(53, 0x28, 0x28, 0x50, 0, 0x0100'00'FF, 1, NumpadDownArrow , DownArrow )\ - X(54, 0x30, 0x30, 0x0B, 0, 0x0000'FF'FF, 1, Key0 , 0 )\ - X(55, 0x60, 0x60, 0x52, NumLockMode, 0x0000'FF'FF, 1, Numpad0 , 0 )\ - X(56, 0x31, 0x31, 0x02, 0, 0x0000'FF'FF, 1, Key1 , 1 )\ - X(57, 0x61, 0x61, 0x4F, NumLockMode, 0x0000'FF'FF, 1, Numpad1 , 1 )\ - X(58, 0x32, 0x32, 0x03, 0, 0x0000'FF'FF, 1, Key2 , 2 )\ - X(59, 0x62, 0x62, 0x50, NumLockMode, 0x0000'FF'FF, 1, Numpad2 , 2 )\ - X(60, 0x33, 0x33, 0x04, 0, 0x0000'FF'FF, 1, Key3 , 3 )\ - X(61, 0x63, 0x63, 0x51, NumLockMode, 0x0000'FF'FF, 1, Numpad3 , 3 )\ - X(62, 0x34, 0x34, 0x05, 0, 0x0000'FF'FF, 1, Key4 , 4 )\ - X(63, 0x64, 0x64, 0x4B, NumLockMode, 0x0000'FF'FF, 1, Numpad4 , 4 )\ - X(64, 0x35, 0x35, 0x06, 0, 0x0000'FF'FF, 1, Key5 , 5 )\ - X(65, 0x65, 0x65, 0x4C, NumLockMode, 0x0000'FF'FF, 1, Numpad5 , 5 )\ - X(66, 0x36, 0x36, 0x07, 0, 0x0000'FF'FF, 1, Key6 , 6 )\ - X(67, 0x66, 0x66, 0x4D, NumLockMode, 0x0000'FF'FF, 1, Numpad6 , 6 )\ - X(68, 0x37, 0x37, 0x08, 0, 0x0000'FF'FF, 1, Key7 , 7 )\ - X(69, 0x67, 0x67, 0x47, NumLockMode, 0x0000'FF'FF, 1, Numpad7 , 7 )\ - X(70, 0x38, 0x38, 0x09, 0, 0x0000'FF'FF, 1, Key8 , 8 )\ - X(71, 0x68, 0x68, 0x48, NumLockMode, 0x0000'FF'FF, 1, Numpad8 , 8 )\ - X(72, 0x39, 0x39, 0x0A, 0, 0x0000'FF'FF, 1, Key9 , 9 )\ - X(73, 0x69, 0x69, 0x49, NumLockMode, 0x0000'FF'FF, 1, Numpad9 , 9 )\ - X(74, 0x2D, 0x2D, 0x52, ExtendedKey, 0x0100'00'FF, 1, KeyInsert , Insert )\ - X(75, 0x2D, 0x2D, 0x52, 0, 0x0100'00'FF, 1, NumpadInsert , Insert )\ - X(76, 0x2E, 0x2E, 0x53, ExtendedKey, 0x0100'00'FF, 1, KeyDelete , Delete )\ - X(77, 0x2E, 0x2E, 0x55, 0, 0x0100'00'FF, 1, NumpadDelete , Delete )\ - X(78, 0x0C, 0x0C, 0x4C, ExtendedKey, 0x0100'00'FF, 1, KeyClear , Clear )\ - X(79, 0x0C, 0x0C, 0x4C, 0, 0x0100'00'FF, 1, NumpadClear , Clear )\ - X(80, 0x6A, 0x6A, 0x09, 0, 0x0000'FF'FF, 1, KeyMultiply , Multiply )\ - X(81, 0x6A, 0x6A, 0x37, 0, 0x0000'FF'FF, 1, NumpadMultiply , Multiply )\ - X(82, 0x6B, 0x6B, 0x0D, 0, 0x0000'FF'FF, 1, KeyPlus , Plus )\ - X(83, 0x6B, 0x6B, 0x4E, 0, 0x0000'FF'FF, 1, NumpadPlus , Plus )\ - X(84, 0x6C, 0x6C, 0, 0, 0x0020'00'FF, 1, KeySeparator , Separator )\ - X(85, 0x6C, 0x6C, 0, NumLockMode, 0x0020'00'FF, 1, NumpadSeparator , Separator )\ - X(86, 0xBD, 0xBD, 0x0C, 0, 0x0000'00'FF, 1, KeyMinus , Minus )\ - X(87, 0x6D, 0x6D, 0x4A, 0, 0x0000'00'FF, 1, NumpadMinus , Minus )\ - X(88, 0xBE, 0xBE, 0x34, 0, 0x0000'00'FF, 1, KeyPeriod , Period )\ - X(89, 0x6E, 0x6E, 0x53, NumLockMode, 0x0000'00'FF, 1, NumpadDecimal , Period )\ - X(90, 0xBF, 0xBF, 0x35, 0, 0x0000'00'FF, 1, KeySlash , Slash )\ - X(91, 0x6F, 0x6F, 0x35, ExtendedKey, 0x0000'00'FF, 1, NumpadSlash , Slash )\ - X(92, 0xDC, 0xDC, 0x2B, 0, 0x0000'00'FF, 1, BackSlash , BackSlash )\ - X(94, 0xDB, 0xDB, 0x1A, 0, 0x0000'00'FF, 1, OpenBracket , OpenBracket )\ - X(96, 0xDD, 0xDD, 0x1B, 0, 0x0000'00'FF, 1, ClosedBracket , ClosedBracket )\ - X(98, 0xBB, 0xBB, 0x0D, 0, 0x0000'00'FF, 1, Equal , Equal )\ - X(100, 0xC0, 0xC0, 0x29, 0, 0x0000'00'FF, 1, BackQuote , BackQuote )\ - X(102, 0xDE, 0xDE, 0x28, 0, 0x0000'00'FF, 1, SingleQuote , SingleQuote )\ - X(104, 0xBC, 0xBC, 0x33, 0, 0x0000'00'FF, 1, Comma , Comma )\ - X(106, 0xBA, 0xBA, 0x27, 0, 0x0000'00'FF, 1, Semicolon , Semicolon )\ - X(108, 0x70, 0x70, 0x3B, 0, 0x0000'00'FF, 1, F1 , F1 )\ - X(110, 0x71, 0x71, 0x3C, 0, 0x0000'00'FF, 1, F2 , F2 )\ - X(112, 0x72, 0x72, 0x3D, 0, 0x0000'00'FF, 1, F3 , F3 )\ - X(114, 0x73, 0x73, 0x3E, 0, 0x0000'00'FF, 1, F4 , F4 )\ - X(116, 0x74, 0x74, 0x3F, 0, 0x0000'00'FF, 1, F5 , F5 )\ - X(118, 0x75, 0x75, 0x40, 0, 0x0000'00'FF, 1, F6 , F6 )\ - X(120, 0x76, 0x76, 0x41, 0, 0x0000'00'FF, 1, F7 , F7 )\ - X(122, 0x77, 0x77, 0x42, 0, 0x0000'00'FF, 1, F8 , F8 )\ - X(124, 0x78, 0x78, 0x43, 0, 0x0000'00'FF, 1, F9 , F9 )\ - X(126, 0x79, 0x79, 0x44, 0, 0x0000'00'FF, 1, F10 , F10 )\ - X(128, 0x7A, 0x7A, 0x57, 0, 0x0000'00'FF, 1, F11 , F11 )\ - X(130, 0x7B, 0x7B, 0x5B, 0, 0x0000'00'FF, 1, F12 , F12 )\ - X(132, 0x7C, 0x7C, 0, 0, 0x0000'00'FF, 1, F13 , F13 )\ - X(134, 0x7D, 0x7D, 0, 0, 0x0000'00'FF, 1, F14 , F14 )\ - X(136, 0x7E, 0x7E, 0, 0, 0x0000'00'FF, 1, F15 , F15 )\ - X(138, 0x7F, 0x7F, 0, 0, 0x0000'00'FF, 1, F16 , F16 )\ - X(140, 0x80, 0x80, 0, 0, 0x0000'00'FF, 1, F17 , F17 )\ - X(142, 0x81, 0x81, 0, 0, 0x0000'00'FF, 1, F18 , F18 )\ - X(144, 0x82, 0x82, 0, 0, 0x0000'00'FF, 1, F19 , F19 )\ - X(146, 0x83, 0x83, 0, 0, 0x0000'00'FF, 1, F20 , F20 )\ - X(148, 0x84, 0x84, 0, 0, 0x0000'00'FF, 1, F21 , F21 )\ - X(150, 0x85, 0x85, 0, 0, 0x0000'00'FF, 1, F22 , F22 )\ - X(152, 0x86, 0x86, 0, 0, 0x0000'00'FF, 1, F23 , F23 )\ - X(154, 0x87, 0x87, 0, 0, 0x0000'00'FF, 1, F24 , F24 )\ - X(156, 0x41, 0x41, 0, 0, 0x0100'00'FF, 1, KeyA , A )\ - X(158, 0x42, 0x42, 0, 0, 0x0100'00'FF, 1, KeyB , B )\ - X(160, 0x43, 0x43, 0, 0, 0x0100'00'FF, 1, KeyC , C )\ - X(162, 0x44, 0x44, 0, 0, 0x0100'00'FF, 1, KeyD , D )\ - X(164, 0x45, 0x45, 0, 0, 0x0100'00'FF, 1, KeyE , E )\ - X(166, 0x46, 0x46, 0, 0, 0x0100'00'FF, 1, KeyF , F )\ - X(168, 0x47, 0x47, 0, 0, 0x0100'00'FF, 1, KeyG , G )\ - X(170, 0x48, 0x48, 0, 0, 0x0100'00'FF, 1, KeyH , H )\ - X(172, 0x49, 0x49, 0, 0, 0x0100'00'FF, 1, KeyI , I )\ - X(174, 0x4A, 0x4A, 0, 0, 0x0100'00'FF, 1, KeyJ , J )\ - X(176, 0x4B, 0x4B, 0, 0, 0x0100'00'FF, 1, KeyK , K )\ - X(178, 0x4C, 0x4C, 0, 0, 0x0100'00'FF, 1, KeyL , L )\ - X(180, 0x4D, 0x4D, 0, 0, 0x0100'00'FF, 1, KeyM , M )\ - X(182, 0x4E, 0x4E, 0, 0, 0x0100'00'FF, 1, KeyN , N )\ - X(184, 0x4F, 0x4F, 0, 0, 0x0100'00'FF, 1, KeyO , O )\ - X(186, 0x50, 0x50, 0, 0, 0x0100'00'FF, 1, KeyP , P )\ - X(188, 0x51, 0x51, 0, 0, 0x0100'00'FF, 1, KeyQ , Q )\ - X(190, 0x52, 0x52, 0, 0, 0x0100'00'FF, 1, KeyR , R )\ - X(192, 0x53, 0x53, 0, 0, 0x0100'00'FF, 1, KeyS , S )\ - X(194, 0x54, 0x54, 0, 0, 0x0100'00'FF, 1, KeyT , T )\ - X(196, 0x55, 0x55, 0, 0, 0x0100'00'FF, 1, KeyU , U )\ - X(198, 0x56, 0x56, 0, 0, 0x0100'00'FF, 1, KeyV , V )\ - X(200, 0x57, 0x57, 0, 0, 0x0100'00'FF, 1, KeyW , W )\ - X(202, 0x58, 0x58, 0, 0, 0x0100'00'FF, 1, KeyX , X )\ - X(204, 0x59, 0x59, 0, 0, 0x0100'00'FF, 1, KeyY , Y )\ - X(206, 0x5A, 0x5A, 0, 0, 0x0100'00'FF, 1, KeyZ , Z )\ - X(208, 0x5F, 0x5F, 0, ExtendedKey, 0x0100'00'FF, 0, Sleep , Sleep )\ - X(210, 0xB7, 0xB7, 0, ExtendedKey, 0x0100'00'FF, 0, Calculator , Calculator )\ - X(212, 0x48, 0x48, 0, ExtendedKey, 0x0100'00'FF, 0, Mail , Mail )\ - X(214, 0xAD, 0xAD, 0, ExtendedKey, 0x0100'00'FF, 0, MediaVolMute , MediaVolMute )\ - X(216, 0xAE, 0xAE, 0, ExtendedKey, 0x0100'00'FF, 0, MediaVolDown , MediaVolDown )\ - X(218, 0xAF, 0xAF, 0, ExtendedKey, 0x0100'00'FF, 0, MediaVolUp , MediaVolUp )\ - X(220, 0xB0, 0xB0, 0, ExtendedKey, 0x0100'00'FF, 0, MediaNext , MediaNext )\ - X(222, 0xB1, 0xB1, 0, ExtendedKey, 0x0100'00'FF, 0, MediaPrev , MediaPrev )\ - X(224, 0xB2, 0xB2, 0, ExtendedKey, 0x0100'00'FF, 0, MediaStop , MediaStop )\ - X(226, 0xB3, 0xB3, 0, ExtendedKey, 0x0100'00'FF, 0, MediaPlayPause , MediaPlayPause )\ - X(228, 0xB5, 0xB5, 0, ExtendedKey, 0x0100'00'FF, 0, MediaSelect , MediaSelect )\ - X(230, 0xA6, 0xA6, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserBack , BrowserBack )\ - X(232, 0xA7, 0xA7, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserForward , BrowserForward )\ - X(234, 0xA8, 0xA8, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserRefresh , BrowserRefresh )\ - X(236, 0xA9, 0xA9, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserStop , BrowserStop )\ - X(238, 0xAA, 0xAA, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserSearch , BrowserSearch )\ - X(240, 0xAB, 0xAB, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserFavorites, BrowserFavorites )\ - X(242, 0xAC, 0xAC, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserHome , BrowserHome ) + /*Id Index Vkey Scan CtrlState Mask I Name GenericName */\ + X(0, 0, 0, 0, 0, 0x0000'00'FF, 1, undef , "undef" )\ + X(1, 0, 0xFF, 0xFF, 0, 0x0000'FF'FF, 0, config , "config" )\ + X(2, 0xA2, 0x11, 0x1D, 0, 0x0100'00'FF, 0, LeftCtrl , "Ctrl" )\ + X(3, 0xA3, 0x11, 0x1D, ExtendedKey, 0x0100'00'FF, 0, RightCtrl , "Ctrl" )\ + X(4, 0xA4, 0x12, 0x38, 0, 0x0100'00'FF, 0, LeftAlt , "Alt" )\ + X(5, 0xA5, 0x12, 0x38, ExtendedKey, 0x0100'00'FF, 0, RightAlt , "Alt" )\ + X(6, 0xA0, 0x10, 0x2A, 0, 0x0000'FF'FF, 0, LeftShift , "Shift" )\ + X(7, 0xA1, 0x10, 0x36, 0, 0x0000'FF'FF, 0, RightShift , "Shift" )\ + X(8, 0x5B, 0x5B, 0x5B, ExtendedKey, 0x0000'00'FF, 0, LeftWin , "Win" )\ + X(9, 0x5C, 0x5C, 0x5C, ExtendedKey, 0x0000'00'FF, 0, RightWin , "Win" )\ + X(10, 0x5D, 0x5D, 0x5D, ExtendedKey, 0x0000'00'FF, 0, Apps , "Apps" )\ + X(12, 0x90, 0x90, 0x45, 0, 0x0000'00'FF, 0, NumLock , "NumLock" )\ + X(14, 0x14, 0x14, 0x3A, 0, 0x0000'00'FF, 0, CapsLock , "CapsLock" )\ + X(16, 0x91, 0x91, 0x45, 0, 0x0000'00'FF, 0, ScrollLock , "ScrollLock" )\ + X(18, 0x1B, 0x1B, 0x01, 0, 0x0000'00'FF, 1, Esc , "Esc" )\ + X(20, 0x20, 0x20, 0x39, 0, 0x0000'00'FF, 1, Space , "Space" )\ + X(22, 0x08, 0x08, 0x0E, 0, 0x0000'00'FF, 1, Backspace , "Backspace" )\ + X(24, 0x09, 0x09, 0x0F, 0, 0x0000'00'FF, 1, Tab , "Tab" )\ + X(26, 0x03, 0x03, 0x46, 0, 0x0000'FF'FF, 1, Break , "Break" )\ + X(28, 0x13, 0x13, 0x45, 0, 0x0000'FF'FF, 0, Pause , "Pause" )\ + X(30, 0x29, 0x29, 0, 0, 0x0000'00'FF, 0, Select , "Select" )\ + X(32, 0x2C, 0x2C, 0x54, 0, 0x0000'FF'FF, 1, SysRq , "SysRq" )\ + X(34, 0x2C, 0x2C, 0x37, ExtendedKey, 0x0100'FF'FF, 0, PrintScreen , "PrintScreen" )\ + X(36, 0x0D, 0x0D, 0x1C, 0, 0x0100'00'FF, 1, KeyEnter , "Enter" )\ + X(37, 0x0D, 0x0D, 0x1C, ExtendedKey, 0x0100'00'FF, 1, NumpadEnter , "Enter" )\ + X(38, 0x21, 0x21, 0x49, ExtendedKey, 0x0100'00'FF, 1, KeyPageUp , "PageUp" )\ + X(39, 0x21, 0x21, 0x49, 0, 0x0100'00'FF, 1, NumpadPageUp , "PageUp" )\ + X(40, 0x22, 0x22, 0x51, ExtendedKey, 0x0100'00'FF, 1, KeyPageDown , "PageDown" )\ + X(41, 0x22, 0x22, 0x51, 0, 0x0100'00'FF, 1, NumpadPageDown , "PageDown" )\ + X(42, 0x23, 0x23, 0x4F, ExtendedKey, 0x0100'00'FF, 1, KeyEnd , "End" )\ + X(43, 0x23, 0x23, 0x4F, 0, 0x0100'00'FF, 1, NumpadEnd , "End" )\ + X(44, 0x24, 0x24, 0x47, ExtendedKey, 0x0100'00'FF, 1, KeyHome , "Home" )\ + X(45, 0x24, 0x24, 0x47, 0, 0x0100'00'FF, 1, NumpadHome , "Home" )\ + X(46, 0x25, 0x25, 0x4B, ExtendedKey, 0x0100'00'FF, 1, KeyLeftArrow , "LeftArrow" )\ + X(47, 0x25, 0x25, 0x4B, 0, 0x0100'00'FF, 1, NumpadLeftArrow , "LeftArrow" )\ + X(48, 0x26, 0x26, 0x48, ExtendedKey, 0x0100'00'FF, 1, KeyUpArrow , "UpArrow" )\ + X(49, 0x26, 0x26, 0x48, 0, 0x0100'00'FF, 1, NumpadUpArrow , "UpArrow" )\ + X(50, 0x27, 0x27, 0x4D, ExtendedKey, 0x0100'00'FF, 1, KeyRightArrow , "RightArrow" )\ + X(51, 0x27, 0x27, 0x4D, 0, 0x0100'00'FF, 1, NumpadRightArrow, "RightArrow" )\ + X(52, 0x28, 0x28, 0x50, ExtendedKey, 0x0100'00'FF, 1, KeyDownArrow , "DownArrow" )\ + X(53, 0x28, 0x28, 0x50, 0, 0x0100'00'FF, 1, NumpadDownArrow , "DownArrow" )\ + X(54, 0x30, 0x30, 0x0B, 0, 0x0000'FF'FF, 1, Key0 , "0" )\ + X(55, 0x60, 0x60, 0x52, NumLockMode, 0x0000'FF'FF, 1, Numpad0 , "0" )\ + X(56, 0x31, 0x31, 0x02, 0, 0x0000'FF'FF, 1, Key1 , "1" )\ + X(57, 0x61, 0x61, 0x4F, NumLockMode, 0x0000'FF'FF, 1, Numpad1 , "1" )\ + X(58, 0x32, 0x32, 0x03, 0, 0x0000'FF'FF, 1, Key2 , "2" )\ + X(59, 0x62, 0x62, 0x50, NumLockMode, 0x0000'FF'FF, 1, Numpad2 , "2" )\ + X(60, 0x33, 0x33, 0x04, 0, 0x0000'FF'FF, 1, Key3 , "3" )\ + X(61, 0x63, 0x63, 0x51, NumLockMode, 0x0000'FF'FF, 1, Numpad3 , "3" )\ + X(62, 0x34, 0x34, 0x05, 0, 0x0000'FF'FF, 1, Key4 , "4" )\ + X(63, 0x64, 0x64, 0x4B, NumLockMode, 0x0000'FF'FF, 1, Numpad4 , "4" )\ + X(64, 0x35, 0x35, 0x06, 0, 0x0000'FF'FF, 1, Key5 , "5" )\ + X(65, 0x65, 0x65, 0x4C, NumLockMode, 0x0000'FF'FF, 1, Numpad5 , "5" )\ + X(66, 0x36, 0x36, 0x07, 0, 0x0000'FF'FF, 1, Key6 , "6" )\ + X(67, 0x66, 0x66, 0x4D, NumLockMode, 0x0000'FF'FF, 1, Numpad6 , "6" )\ + X(68, 0x37, 0x37, 0x08, 0, 0x0000'FF'FF, 1, Key7 , "7" )\ + X(69, 0x67, 0x67, 0x47, NumLockMode, 0x0000'FF'FF, 1, Numpad7 , "7" )\ + X(70, 0x38, 0x38, 0x09, 0, 0x0000'FF'FF, 1, Key8 , "8" )\ + X(71, 0x68, 0x68, 0x48, NumLockMode, 0x0000'FF'FF, 1, Numpad8 , "8" )\ + X(72, 0x39, 0x39, 0x0A, 0, 0x0000'FF'FF, 1, Key9 , "9" )\ + X(73, 0x69, 0x69, 0x49, NumLockMode, 0x0000'FF'FF, 1, Numpad9 , "9" )\ + X(74, 0x2D, 0x2D, 0x52, ExtendedKey, 0x0100'00'FF, 1, KeyInsert , "Insert" )\ + X(75, 0x2D, 0x2D, 0x52, 0, 0x0100'00'FF, 1, NumpadInsert , "Insert" )\ + X(76, 0x2E, 0x2E, 0x53, ExtendedKey, 0x0100'00'FF, 1, KeyDelete , "Delete" )\ + X(77, 0x2E, 0x2E, 0x55, 0, 0x0100'00'FF, 1, NumpadDelete , "Delete" )\ + X(78, 0x0C, 0x0C, 0x4C, ExtendedKey, 0x0100'00'FF, 1, KeyClear , "Clear" )\ + X(79, 0x0C, 0x0C, 0x4C, 0, 0x0100'00'FF, 1, NumpadClear , "Clear" )\ + X(80, 0x6A, 0x6A, 0x09, 0, 0x0000'FF'FF, 1, KeyMultiply , "*" )\ + X(81, 0x6A, 0x6A, 0x37, 0, 0x0000'FF'FF, 1, NumpadMultiply , "*" )\ + X(82, 0x6B, 0x6B, 0x0D, 0, 0x0000'FF'FF, 1, KeyPlus , "Plus" )\ + X(83, 0x6B, 0x6B, 0x4E, 0, 0x0000'FF'FF, 1, NumpadPlus , "Plus" )\ + X(84, 0x6C, 0x6C, 0, 0, 0x0020'00'FF, 1, KeySeparator , "Separator" )\ + X(85, 0x6C, 0x6C, 0, NumLockMode, 0x0020'00'FF, 1, NumpadSeparator , "Separator" )\ + X(86, 0xBD, 0xBD, 0x0C, 0, 0x0000'00'FF, 1, KeyMinus , "Minus" )\ + X(87, 0x6D, 0x6D, 0x4A, 0, 0x0000'00'FF, 1, NumpadMinus , "Minus" )\ + X(88, 0xBE, 0xBE, 0x34, 0, 0x0000'00'FF, 1, KeyPeriod , "." )\ + X(89, 0x6E, 0x6E, 0x53, NumLockMode, 0x0000'00'FF, 1, NumpadDecimal , "." )\ + X(90, 0xBF, 0xBF, 0x35, 0, 0x0000'00'FF, 1, KeySlash , "/" )\ + X(91, 0x6F, 0x6F, 0x35, ExtendedKey, 0x0000'00'FF, 1, NumpadSlash , "/" )\ + X(92, 0xDC, 0xDC, 0x2B, 0, 0x0000'00'FF, 1, BackSlash , "BackSlash" )\ + X(94, 0xDB, 0xDB, 0x1A, 0, 0x0000'00'FF, 1, OpenBracket , "[" )\ + X(96, 0xDD, 0xDD, 0x1B, 0, 0x0000'00'FF, 1, ClosedBracket , "]" )\ + X(98, 0xBB, 0xBB, 0x0D, 0, 0x0000'00'FF, 1, Equal , "=" )\ + X(100, 0xC0, 0xC0, 0x29, 0, 0x0000'00'FF, 1, BackQuote , "`" )\ + X(102, 0xDE, 0xDE, 0x28, 0, 0x0000'00'FF, 1, SingleQuote , "'" )\ + X(104, 0xBC, 0xBC, 0x33, 0, 0x0000'00'FF, 1, Comma , "," )\ + X(106, 0xBA, 0xBA, 0x27, 0, 0x0000'00'FF, 1, Semicolon , ";" )\ + X(108, 0x70, 0x70, 0x3B, 0, 0x0000'00'FF, 1, F1 , "F1" )\ + X(110, 0x71, 0x71, 0x3C, 0, 0x0000'00'FF, 1, F2 , "F2" )\ + X(112, 0x72, 0x72, 0x3D, 0, 0x0000'00'FF, 1, F3 , "F3" )\ + X(114, 0x73, 0x73, 0x3E, 0, 0x0000'00'FF, 1, F4 , "F4" )\ + X(116, 0x74, 0x74, 0x3F, 0, 0x0000'00'FF, 1, F5 , "F5" )\ + X(118, 0x75, 0x75, 0x40, 0, 0x0000'00'FF, 1, F6 , "F6" )\ + X(120, 0x76, 0x76, 0x41, 0, 0x0000'00'FF, 1, F7 , "F7" )\ + X(122, 0x77, 0x77, 0x42, 0, 0x0000'00'FF, 1, F8 , "F8" )\ + X(124, 0x78, 0x78, 0x43, 0, 0x0000'00'FF, 1, F9 , "F9" )\ + X(126, 0x79, 0x79, 0x44, 0, 0x0000'00'FF, 1, F10 , "F10" )\ + X(128, 0x7A, 0x7A, 0x57, 0, 0x0000'00'FF, 1, F11 , "F11" )\ + X(130, 0x7B, 0x7B, 0x5B, 0, 0x0000'00'FF, 1, F12 , "F12" )\ + X(132, 0x7C, 0x7C, 0, 0, 0x0000'00'FF, 1, F13 , "F13" )\ + X(134, 0x7D, 0x7D, 0, 0, 0x0000'00'FF, 1, F14 , "F14" )\ + X(136, 0x7E, 0x7E, 0, 0, 0x0000'00'FF, 1, F15 , "F15" )\ + X(138, 0x7F, 0x7F, 0, 0, 0x0000'00'FF, 1, F16 , "F16" )\ + X(140, 0x80, 0x80, 0, 0, 0x0000'00'FF, 1, F17 , "F17" )\ + X(142, 0x81, 0x81, 0, 0, 0x0000'00'FF, 1, F18 , "F18" )\ + X(144, 0x82, 0x82, 0, 0, 0x0000'00'FF, 1, F19 , "F19" )\ + X(146, 0x83, 0x83, 0, 0, 0x0000'00'FF, 1, F20 , "F20" )\ + X(148, 0x84, 0x84, 0, 0, 0x0000'00'FF, 1, F21 , "F21" )\ + X(150, 0x85, 0x85, 0, 0, 0x0000'00'FF, 1, F22 , "F22" )\ + X(152, 0x86, 0x86, 0, 0, 0x0000'00'FF, 1, F23 , "F23" )\ + X(154, 0x87, 0x87, 0, 0, 0x0000'00'FF, 1, F24 , "F24" )\ + X(156, 0x41, 0x41, 0, 0, 0x0100'00'FF, 1, KeyA , "A" )\ + X(158, 0x42, 0x42, 0, 0, 0x0100'00'FF, 1, KeyB , "B" )\ + X(160, 0x43, 0x43, 0, 0, 0x0100'00'FF, 1, KeyC , "C" )\ + X(162, 0x44, 0x44, 0, 0, 0x0100'00'FF, 1, KeyD , "D" )\ + X(164, 0x45, 0x45, 0, 0, 0x0100'00'FF, 1, KeyE , "E" )\ + X(166, 0x46, 0x46, 0, 0, 0x0100'00'FF, 1, KeyF , "F" )\ + X(168, 0x47, 0x47, 0, 0, 0x0100'00'FF, 1, KeyG , "G" )\ + X(170, 0x48, 0x48, 0, 0, 0x0100'00'FF, 1, KeyH , "H" )\ + X(172, 0x49, 0x49, 0, 0, 0x0100'00'FF, 1, KeyI , "I" )\ + X(174, 0x4A, 0x4A, 0, 0, 0x0100'00'FF, 1, KeyJ , "J" )\ + X(176, 0x4B, 0x4B, 0, 0, 0x0100'00'FF, 1, KeyK , "K" )\ + X(178, 0x4C, 0x4C, 0, 0, 0x0100'00'FF, 1, KeyL , "L" )\ + X(180, 0x4D, 0x4D, 0, 0, 0x0100'00'FF, 1, KeyM , "M" )\ + X(182, 0x4E, 0x4E, 0, 0, 0x0100'00'FF, 1, KeyN , "N" )\ + X(184, 0x4F, 0x4F, 0, 0, 0x0100'00'FF, 1, KeyO , "O" )\ + X(186, 0x50, 0x50, 0, 0, 0x0100'00'FF, 1, KeyP , "P" )\ + X(188, 0x51, 0x51, 0, 0, 0x0100'00'FF, 1, KeyQ , "Q" )\ + X(190, 0x52, 0x52, 0, 0, 0x0100'00'FF, 1, KeyR , "R" )\ + X(192, 0x53, 0x53, 0, 0, 0x0100'00'FF, 1, KeyS , "S" )\ + X(194, 0x54, 0x54, 0, 0, 0x0100'00'FF, 1, KeyT , "T" )\ + X(196, 0x55, 0x55, 0, 0, 0x0100'00'FF, 1, KeyU , "U" )\ + X(198, 0x56, 0x56, 0, 0, 0x0100'00'FF, 1, KeyV , "V" )\ + X(200, 0x57, 0x57, 0, 0, 0x0100'00'FF, 1, KeyW , "W" )\ + X(202, 0x58, 0x58, 0, 0, 0x0100'00'FF, 1, KeyX , "X" )\ + X(204, 0x59, 0x59, 0, 0, 0x0100'00'FF, 1, KeyY , "Y" )\ + X(206, 0x5A, 0x5A, 0, 0, 0x0100'00'FF, 1, KeyZ , "Z" )\ + X(208, 0x5F, 0x5F, 0, ExtendedKey, 0x0100'00'FF, 0, Sleep , "Sleep" )\ + X(210, 0xB7, 0xB7, 0, ExtendedKey, 0x0100'00'FF, 0, Calculator , "Calculator" )\ + X(212, 0x48, 0x48, 0, ExtendedKey, 0x0100'00'FF, 0, Mail , "Mail" )\ + X(214, 0xAD, 0xAD, 0, ExtendedKey, 0x0100'00'FF, 0, MediaVolMute , "MediaVolMute" )\ + X(216, 0xAE, 0xAE, 0, ExtendedKey, 0x0100'00'FF, 0, MediaVolDown , "MediaVolDown" )\ + X(218, 0xAF, 0xAF, 0, ExtendedKey, 0x0100'00'FF, 0, MediaVolUp , "MediaVolUp" )\ + X(220, 0xB0, 0xB0, 0, ExtendedKey, 0x0100'00'FF, 0, MediaNext , "MediaNext" )\ + X(222, 0xB1, 0xB1, 0, ExtendedKey, 0x0100'00'FF, 0, MediaPrev , "MediaPrev" )\ + X(224, 0xB2, 0xB2, 0, ExtendedKey, 0x0100'00'FF, 0, MediaStop , "MediaStop" )\ + X(226, 0xB3, 0xB3, 0, ExtendedKey, 0x0100'00'FF, 0, MediaPlayPause , "MediaPlayPause" )\ + X(228, 0xB5, 0xB5, 0, ExtendedKey, 0x0100'00'FF, 0, MediaSelect , "MediaSelect" )\ + X(230, 0xA6, 0xA6, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserBack , "BrowserBack" )\ + X(232, 0xA7, 0xA7, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserForward , "BrowserForward" )\ + X(234, 0xA8, 0xA8, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserRefresh , "BrowserRefresh" )\ + X(236, 0xA9, 0xA9, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserStop , "BrowserStop" )\ + X(238, 0xAA, 0xAA, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserSearch , "BrowserSearch" )\ + X(240, 0xAB, 0xAB, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserFavorites, "BrowserFavorites")\ + X(242, 0xAC, 0xAC, 0, ExtendedKey, 0x0100'00'FF, 0, BrowserHome , "BrowserHome" ) #define X(KeyId, Index, Vkey, Scan, CtrlState, Mask, Input, Name, GenericName) \ static constexpr auto Name = KeyId; @@ -499,7 +499,7 @@ namespace netxs::input static const auto keymap = std::unordered_map { #define X(KeyId, Index, Vkey, Scan, CtrlState, Mask, Input, Name, GenericName) \ - { map{ Vkey, Scan, CtrlState, Mask, #Name, #GenericName, Input, Name }, Name }, + { map{ Vkey, Scan, CtrlState, Mask, #Name, GenericName, Input, Name }, Name }, key_list #undef X }; @@ -514,7 +514,7 @@ namespace netxs::input static const auto generic_names = std::unordered_map { #define X(KeyId, Index, Vkey, Scan, CtrlState, Mask, Input, Name, GenericName) \ - { utf::to_low(#GenericName), KeyId & -2 }, + { utf::to_low(GenericName), KeyId & -2 }, key_list #undef X }; @@ -640,7 +640,9 @@ namespace netxs::input } else if (s & 0x20) // Cluster. { - crop += '\'' + utf::debase(chord) + '\''; + auto plain = utf::debase(chord); + utf::replace_all(plain, "'", "\\'"); + crop += '\'' + plain + '\''; chord.clear(); } else // Keyids @@ -706,12 +708,12 @@ namespace netxs::input k.code1 = v.value(); } } - else if (chord.front() == '\'' || chord.front() == '\"') + else if (chord.size() > 2 && chord.front() == chord.back() && (chord.front() == '\'' || chord.front() == '\"')) // The literal key must be the last key in a sequence. { - auto delim = chord.front(); k.sign |= 0x20; - k.utf8 = utf::unescape(utf::take_quote(chord, (char)delim)); + k.utf8 = utf::unescape(chord.substr(1, chord.size() - 2)); k.code1 = 0xFF; + chord.clear(); } else if (auto key_name = qiew{ utf::get_word(chord, "+- ") }) { diff --git a/src/netxs/desktopio/richtext.hpp b/src/netxs/desktopio/richtext.hpp index 38358c86e7..fee2a64274 100644 --- a/src/netxs/desktopio/richtext.hpp +++ b/src/netxs/desktopio/richtext.hpp @@ -1457,15 +1457,13 @@ namespace netxs::ui auto size() const { return lyric->size(); } // para: Return 2D volume size. auto& back() const { return brush; } // para: Return current brush. bool busy() const { return length() || !parser::empty() || brush.busy(); } // para: Is it filled. - void ease() { brush.nil(); lyric->each([&](auto& c){ c.clr(brush); }); } // para: Reset color for all text. - void link(id_t id) { lyric->each([&](auto& c){ c.link(id); }); } // para: Set object ID for each cell. + void ease() { lyric->each([&](auto& c){ c.clr({}); }); } // para: Reset color for all text. + void link(id_t id) { lyric->each([&](auto& c){ c.link(id); }); } // para: Set object ID for each cell. + template void wipe(cell c = cell{}) // para: Clear the text and locus, and reset SGR attributes. { - parser::reset(c); + parser::reset(c); caret = 0; - //todo revise - //style.rst(); - //proto.clear(); locus.kill(); lyric->kill(); } @@ -2041,7 +2039,7 @@ namespace netxs::ui index = 0; auto& item = **layer; item.id(index); - item.wipe(parser::brush); + item.wipe(parser::brush); reindex(); return *this; } diff --git a/src/netxs/desktopio/terminal.hpp b/src/netxs/desktopio/terminal.hpp index 6b22e88427..7f5f7a9de3 100644 --- a/src/netxs/desktopio/terminal.hpp +++ b/src/netxs/desktopio/terminal.hpp @@ -7805,23 +7805,6 @@ namespace netxs::ui switch (gear.payload) { case keybd::type::keypress: - if (io_log) - { - log(prompt::key, ansi::hi(input::key::map::data(gear.keycode).name), gear.keystat == input::key::pressed ? " pressed" : gear.keystat == input::key::repeated ? "repeated" : " released"); - if (gear.vkchord.size() && gear.keystat != input::key::repeated) - { - auto vkchord = input::key::kmap::to_string(gear.vkchord, faux); - auto scchord = input::key::kmap::to_string(gear.scchord, faux); - auto chchord = input::key::kmap::to_string(gear.chchord, faux); - auto gen_vkchord = input::key::kmap::to_string(gear.vkchord, true); - auto gen_chchord = input::key::kmap::to_string(gear.chchord, true); - log("Keyboard chords: %% %% %%", utf::buffer_to_hex(gear.vkchord), utf::buffer_to_hex(gear.scchord), utf::buffer_to_hex(gear.chchord), - "\n Virtual keys: ", vkchord.size() ? "\"" + (vkchord == gen_vkchord ? vkchord : gen_vkchord + "\" \"" + vkchord) + "\"" : "", - "\n Grapheme cluster: ", chchord.size() ? "\"" + (chchord == gen_chchord ? chchord : gen_chchord + "\" \"" + chchord) + "\"" : "", - "\n Scancodes: ", scchord.size() ? "\"" + scchord + "\"" : "", - "\n"); - } - } if (gear.handled) break; // Don't pass registered keyboard shortcuts. if (config.resetonkey && gear.doinput()) { diff --git a/src/vtm.xml b/src/vtm.xml index afae9259b9..957d9cd638 100644 --- a/src/vtm.xml +++ b/src/vtm.xml @@ -33,8 +33,8 @@ R"==( - - + + From eadb7c57a922889e97a3a0ea7177070e4060bfe4 Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Sat, 9 Nov 2024 22:42:56 +0500 Subject: [PATCH 02/12] #86 WIP: Fix cooked-read paste (cmd.exe) --- src/netxs/desktopio/consrv.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/netxs/desktopio/consrv.hpp b/src/netxs/desktopio/consrv.hpp index db2c8ed7af..354f0434c5 100644 --- a/src/netxs/desktopio/consrv.hpp +++ b/src/netxs/desktopio/consrv.hpp @@ -1371,6 +1371,23 @@ struct impl : consrv } } } + else if (rec.EventType == MENU_EVENT) //todo implement + { + if (rec.Event.MenuEvent.dwCommandId == (nt::console::event::custom | nt::console::event::paste_begin)) + { + wcpair = {}; + cooked.ctrl = 0; + //clip = true; + //cooked.ustr += ansi::paste_begin; + } + else if (rec.Event.MenuEvent.dwCommandId == (nt::console::event::custom | nt::console::event::paste_end)) + { + wcpair = {}; + done = true; // Update terminal viewport. + //clip = faux; + //cooked.ustr += ansi::paste_end; + } + } //else if (nums && v == VK_MENU) // Alt is released after num digits input. //{ // server.inpenc->decode(nums, buff); From bb381db3e41c2ad8e9d8830de4e344950b398cfb Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Sat, 9 Nov 2024 23:20:12 +0500 Subject: [PATCH 03/12] #86 WIP: Introduce ToggleDebugOverlay --- doc/settings.md | 7 +++++-- src/netxs/desktopio/console.hpp | 20 ++++++-------------- src/vtm.hpp | 1 - src/vtm.xml | 7 +++++-- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/doc/settings.md b/doc/settings.md index f5485ed8a0..ea6b3f34fa 100644 --- a/doc/settings.md +++ b/doc/settings.md @@ -477,9 +477,12 @@ Notes - - + + + + + diff --git a/src/netxs/desktopio/console.hpp b/src/netxs/desktopio/console.hpp index 9a40f6218b..896a4bdb1f 100644 --- a/src/netxs/desktopio/console.hpp +++ b/src/netxs/desktopio/console.hpp @@ -234,8 +234,8 @@ namespace netxs::ui } void handle(s11n::xs::syskeybd lock) { - auto& keybd = lock.thing; - notify(e2::conio::keybd, keybd); + auto& item = lock.thing; + notify(e2::conio::keybd, item); } void handle(s11n::xs::sysmouse lock) { @@ -439,7 +439,6 @@ namespace netxs::ui cell tooltip_colors; // conf: Tooltip rendering colors. bool tooltip_enabled; // conf: Enable tooltips. bool debug_overlay; // conf: Enable to show debug overlay. - text debug_toggle; // conf: Debug toggle shortcut. bool show_regions; // conf: Highlight region ownership. bool simple; // conf: . svga vtmode; // conf: . @@ -459,7 +458,6 @@ namespace netxs::ui tooltip_timeout = config.take("/config/tooltips/timeout" , span{ 2000ms }); tooltip_enabled = config.take("/config/tooltips/enabled" , true); debug_overlay = config.take("/config/debug/overlay" , faux); - debug_toggle = config.take("/config/debug/toggle" , "🐞"s); show_regions = config.take("/config/debug/regions" , faux); clip_preview_glow = std::clamp(clip_preview_glow, 0, 5); } @@ -859,6 +857,7 @@ namespace netxs::ui props_t props; // gate: Application properties. input_t input; // gate: Input event handler. debug_t debug; // gate: Statistics monitor. + pro::keybd keybd; // gate: Keyboard controller. diff paint; // gate: Render. link conio; // gate: Input data parser. bool direct; // gate: . @@ -1124,6 +1123,7 @@ namespace netxs::ui props{ canal, userid, vtmode, isvtm, session_id, config }, input{ props, *this }, debug{*this }, + keybd{*this }, paint{ canal, props.vtmode }, conio{ canal, *this }, direct{ !!(vtmode & (ui::console::direct | ui::console::gui)) }, @@ -1134,6 +1134,8 @@ namespace netxs::ui //todo revise //auto simple = config.take("/config/simple", faux); // DirectVT Gateway console case. config.set("/config/simple", faux); + keybd.proc("ToggleDebugOverlay", [&](hids& gear){ gear.set_handled(); debug ? debug.stop() : debug.start(); }); + keybd.load(config, "/config/debug/hotkeys/key"); base::root(true); base::limits(dot_11); @@ -1284,16 +1286,6 @@ namespace netxs::ui //todo hids //proc(input.gear); }; - LISTEN(tier::preview, hids::events::keybd::key::any, gear, tokens) - { - //todo unify - //todo key action="DebugOverlayToggle" - if (gear.keybd::cluster == props.debug_toggle) - { - debug ? debug.stop() - : debug.start(); - } - }; LISTEN(tier::preview, hids::events::mouse::button::click::leftright, gear, tokens) { if (gear.clear_clipboard()) diff --git a/src/vtm.hpp b/src/vtm.hpp index eb5fef2e28..37d51d7075 100644 --- a/src/vtm.hpp +++ b/src/vtm.hpp @@ -724,7 +724,6 @@ namespace netxs::app::vtm : public ui::gate { pro::robot robot{*this }; // gate: Animation controller. - pro::keybd keybd{*this }; // gate: Keyboard controller. pro::maker maker{*this }; // gate: Form generator. pro::align align{*this, nexthop }; // gate: Fullscreen access controller. pro::notes notes; // gate: Tooltips for user. diff --git a/src/vtm.xml b/src/vtm.xml index 957d9cd638..c0cd278912 100644 --- a/src/vtm.xml +++ b/src/vtm.xml @@ -58,9 +58,12 @@ R"==( - - + + + + + From ec42d60f42f1c89714c06cc46b2e0b72200aa9e9 Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Sun, 10 Nov 2024 10:49:14 +0500 Subject: [PATCH 04/12] Update doc\architecture.md --- doc/architecture.md | 49 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/doc/architecture.md b/doc/architecture.md index 588a81da6b..07d5ec9bf9 100644 --- a/doc/architecture.md +++ b/doc/architecture.md @@ -1,5 +1,6 @@ # Text-based Desktop Environment Architecture +- [UI Concept](#ui-concept) - [Process model](#process-model) - [Runtime modes](#runtimemodes) - [Desktop applets](#desktopapplets) @@ -30,6 +31,54 @@ - [Desktop Live Panel](panel.md) - [Desktop objects and built-in applications](apps.md) +## UI Concept + +```mermaid +graph TB + subgraph GUI[Native GUI Window] + subgraph TUI[TUI Matrix] + subgraph DESK[Desktop UI] + direction LR + subgraph APP1[Desktop Application] + direction LR + App1[Application UI] + end + subgraph APP2[Desktop Application] + direction LR + App2[Application UI] + end + end + end + end + subgraph GUI2[Generic Text Console] + subgraph TUI2[TUI Matrix] + subgraph DESK2[Desktop UI] + direction LR + subgraph APP21[Desktop Application] + direction LR + App21[Application UI] + end + subgraph APP22[Desktop Application] + direction LR + App22[Application UI] + end + end + end + end + subgraph GUI3[Native GUI Window] + subgraph TUI3[TUI Matrix] + subgraph APP33[Standalone Application] + direction LR + App33[Application UI] + end + end + end +``` + +In vtm, the entire user interface is represented by a mosaic of identically sized text cells, forming a TUI matrix. The resulting TUI matrix is ​​then rendered either into its own GUI window or into a compatible text console. Currently, rendering into a native GUI window is only available on the Windows platform; on Unix platforms, a terminal emulator is required. + +The desktop and applications in vtm are completely abstracted from the graphical interface and do not depend on it. + ## Process model ```mermaid From 3509b5738aafb5708ece7b7b668e399562e9489d Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Sun, 10 Nov 2024 10:51:25 +0500 Subject: [PATCH 05/12] Update doc\architecture.md --- doc/architecture.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/architecture.md b/doc/architecture.md index 07d5ec9bf9..30e25cdca2 100644 --- a/doc/architecture.md +++ b/doc/architecture.md @@ -1,6 +1,6 @@ # Text-based Desktop Environment Architecture -- [UI Concept](#ui-concept) +- [UI concept](#ui-concept) - [Process model](#process-model) - [Runtime modes](#runtimemodes) - [Desktop applets](#desktopapplets) @@ -31,7 +31,7 @@ - [Desktop Live Panel](panel.md) - [Desktop objects and built-in applications](apps.md) -## UI Concept +## UI concept ```mermaid graph TB From b429cbce3344647418dd128732320194d5703680 Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Sun, 10 Nov 2024 10:58:34 +0500 Subject: [PATCH 06/12] Update doc\architecture.md --- doc/architecture.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/architecture.md b/doc/architecture.md index 30e25cdca2..86ea6fa212 100644 --- a/doc/architecture.md +++ b/doc/architecture.md @@ -177,7 +177,7 @@ graph TB - Multiple connected users can share a focused application, while each user can have multiple applications focused. - Users can disconnect from the session and reconnect later. - Sessions with different ids can coexist independently. -- To maximize rendering efficiency and minimize cross-platform issues, along with character-oriented xterm-compatible TUI mode called `ANSI/VT`, vtm supports an additional message-based binary TUI mode called `DirectVT`. +- To maximize rendering efficiency and minimize cross-platform issues, along with character-oriented xterm-compatible IO mode called `ANSI/VT`, vtm supports an additional message-based binary IO mode called `DirectVT`. - All running applications are connected to the desktop environment using `DirectVT Gateway` windows as DirectVT endpoints. - A DirectVT-aware application directly connected to the environment can seamlessly send and receive the entire set of desktop events, as well as render themselves in binary form, avoiding expensive ANSI/VT parsing. - To run a non-DirectVT application, an additional vtm host process is launched in `Desktop Applet` mode with the `Teletype Console` or `Terminal Console` applet as a DirectVT bridge to the desktop environment. @@ -206,13 +206,13 @@ Terminal Console | `term` | CUI applications. DirectVT Gateway | `dtvt` | DirectVT-aware applications. DirectVT Gateway with TTY | `dtty` | CUI applications that redirect DirectVT flow to standard IO streams and require user input via platform's TTY. -## TUI modes +## IO modes -A vtm process instance running in `Desktop Client` or `Desktop Applet` mode can operate in one of two TUI modes: either `ANSI/VT` mode or `DirectVT`(`dtvt`) mode. +A vtm process instance running in `Desktop Client` or `Desktop Applet` mode can operate in one of two IO modes: either `ANSI/VT` mode or `DirectVT`(`dtvt`) mode. ### DirectVT mode -In DirectVT TUI mode, vtm process multiplexes the following data channels: +In DirectVT IO mode, vtm process multiplexes the following data channels: - Keyboard event channel - Mouse event channel - Focus event channel @@ -227,7 +227,7 @@ The DirectVT stream can be wrapped in any transport layer protocol suitable for #### Input -In ANSI/VT TUI mode, vtm process parses input from multiple standard sources, and forwards it to the desktop server using the DirectVT transport. The set of input sources varies by platform. +In ANSI/VT IO mode, vtm process parses input from multiple standard sources, and forwards it to the desktop server using the DirectVT transport. The set of input sources varies by platform. ##### Unix input sources From aefe2d247697385c4df8b3c2a784adb5e5d1d47e Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Sun, 10 Nov 2024 11:05:06 +0500 Subject: [PATCH 07/12] Update doc\architecture.md --- doc/architecture.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/architecture.md b/doc/architecture.md index 86ea6fa212..a2812e5f40 100644 --- a/doc/architecture.md +++ b/doc/architecture.md @@ -4,7 +4,7 @@ - [Process model](#process-model) - [Runtime modes](#runtimemodes) - [Desktop applets](#desktopapplets) -- [TUI modes](#tui-modes) +- [IO modes](#io-modes) - [DirectVT mode](#directvt-mode) - [ANSI/VT mode](#ansivt-mode) - [Input](#input) @@ -186,7 +186,7 @@ graph TB ### Runtime modes -Runtime mode | TUI mode | Environment role +Runtime mode | IO mode | Environment role ----------------|--------------------------|------------------ Desktop Applet | auto detected | A desktop applet of an arbitrary type running in its own process that accepts user input and renders itself. Used to place a heavy (complex) desktop object in a separate process in order to optimize desktop resource consumption. Desktop Client | auto detected | A desktop client running in its own process that forwards user input to the desktop and renders the corresponding desktop region with a taskbar overlay. @@ -357,7 +357,7 @@ Do not confuse the `Desktop Applet` names with the desktop object names, even th In general, the local and remote platforms may be different. -When the DirectVT mode is used, all keyboard, mouse and other input events are transmitted between hosts in a binary endianness-aware form. +When the DirectVT IO mode is used, all keyboard, mouse and other input events are transmitted between hosts in a binary endianness-aware form. The following examples assume that vtm is installed on both the local and remote sides. @@ -377,7 +377,7 @@ The following examples assume that vtm is installed on both the local and remote vtm ssh user@server vtm ``` -### Run remote vtm desktop in DirectVT mode over SSH +### Run remote vtm desktop in DirectVT IO mode over SSH - Remote side - Run SSH-server if it is not running. @@ -394,7 +394,7 @@ The following examples assume that vtm is installed on both the local and remote # The `-r dtty` option is auto added if the first command-line argument starts with `ssh` keyword. ``` -### Run remote vtm desktop in ANSI/VT mode over SSH +### Run remote vtm desktop in ANSI/VT IO mode over SSH - Remote side - Run SSH-server if it is not running. @@ -410,7 +410,7 @@ The following examples assume that vtm is installed on both the local and remote # The ssh's `ssh -t ...` option is required to allocate TTY on remote host. ``` -### Run remote vtm desktop in DirectVT mode using `netcat` (POSIX only, unencrypted, for private use only) +### Run remote vtm desktop in DirectVT IO mode using `netcat` (POSIX only, unencrypted, for private use only) - Remote side - Run command: @@ -428,7 +428,7 @@ The following examples assume that vtm is installed on both the local and remote # Note: Make sure `ncat` is installed. ``` -### Run remote vtm desktop in DirectVT mode using `inetd + ncat` (POSIX only, unencrypted, for private use only) +### Run remote vtm desktop in DirectVT IO mode using `inetd + ncat` (POSIX only, unencrypted, for private use only) - Remote side - Install `inetd`. @@ -480,9 +480,9 @@ The taskbar menu can be configured using a settings file `~/.config/vtm/settings - - - + + + From c96b825f24fa9a25600bc622a6b5d4e9b90f6d66 Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Sun, 10 Nov 2024 11:06:54 +0500 Subject: [PATCH 08/12] Update doc\architecture.md --- doc/architecture.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/architecture.md b/doc/architecture.md index a2812e5f40..147918ab76 100644 --- a/doc/architecture.md +++ b/doc/architecture.md @@ -21,10 +21,10 @@ - [Run a CUI application inside the Terminal Console](#run-a-cui-application-inside-the-terminal-console) - [Remote access](#remote-access) - [Run a standalone CUI application remotely over SSH](#run-a-standalone-cui-application-remotely-over-ssh) - - [Run remote vtm desktop in DirectVT mode over SSH](#run-remote-vtm-desktop-in-directvt-mode-over-ssh) + - [Run remote vtm desktop in DirectVT mode over SSH](#run-remote-vtm-desktop-in-directvt-io-mode-over-ssh) - [Run remote vtm desktop in ANSI/VT mode over SSH](#run-remote-vtm-desktop-in-ansivt-mode-over-ssh) - - [Run remote vtm desktop in DirectVT mode using netcat](#run-remote-vtm-desktop-in-directvt-mode-using-netcat-posix-only-unencrypted-for-private-use-only) - - [Run remote vtm desktop in DirectVT mode using inetd + ncat](#run-remote-vtm-desktop-in-directvt-mode-using-inetd--ncat-posix-only-unencrypted-for-private-use-only) + - [Run remote vtm desktop in DirectVT mode using netcat](#run-remote-vtm-desktop-in-directvt-io-mode-using-netcat-posix-only-unencrypted-for-private-use-only) + - [Run remote vtm desktop in DirectVT mode using inetd + ncat](#run-remote-vtm-desktop-in-directvt-io-mode-using-inetd--ncat-posix-only-unencrypted-for-private-use-only) - [Local standard I/O redirection using socat](#local-standard-io-redirection-using-socat-posix-only) - [Standard I/O stream monitoring](#standard-io-stream-monitoring) - [Desktop taskbar customization](#desktop-taskbar-customization) From bbb55575ba655f6153f88d3ff38f65fdafc7a884 Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Sun, 10 Nov 2024 11:10:10 +0500 Subject: [PATCH 09/12] Update doc\architecture.md --- doc/architecture.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/architecture.md b/doc/architecture.md index 147918ab76..44aea4f914 100644 --- a/doc/architecture.md +++ b/doc/architecture.md @@ -21,10 +21,10 @@ - [Run a CUI application inside the Terminal Console](#run-a-cui-application-inside-the-terminal-console) - [Remote access](#remote-access) - [Run a standalone CUI application remotely over SSH](#run-a-standalone-cui-application-remotely-over-ssh) - - [Run remote vtm desktop in DirectVT mode over SSH](#run-remote-vtm-desktop-in-directvt-io-mode-over-ssh) - - [Run remote vtm desktop in ANSI/VT mode over SSH](#run-remote-vtm-desktop-in-ansivt-mode-over-ssh) - - [Run remote vtm desktop in DirectVT mode using netcat](#run-remote-vtm-desktop-in-directvt-io-mode-using-netcat-posix-only-unencrypted-for-private-use-only) - - [Run remote vtm desktop in DirectVT mode using inetd + ncat](#run-remote-vtm-desktop-in-directvt-io-mode-using-inetd--ncat-posix-only-unencrypted-for-private-use-only) + - [Run remote vtm desktop in DirectVT IO mode over SSH](#run-remote-vtm-desktop-in-directvt-io-mode-over-ssh) + - [Run remote vtm desktop in ANSI/VT IO mode over SSH](#run-remote-vtm-desktop-in-ansivt-io-mode-over-ssh) + - [Run remote vtm desktop in DirectVT IO mode using netcat](#run-remote-vtm-desktop-in-directvt-io-mode-using-netcat-posix-only-unencrypted-for-private-use-only) + - [Run remote vtm desktop in DirectVT IO mode using inetd + ncat](#run-remote-vtm-desktop-in-directvt-io-mode-using-inetd--ncat-posix-only-unencrypted-for-private-use-only) - [Local standard I/O redirection using socat](#local-standard-io-redirection-using-socat-posix-only) - [Standard I/O stream monitoring](#standard-io-stream-monitoring) - [Desktop taskbar customization](#desktop-taskbar-customization) From 349949ec6ccf9dc4c403e8e0eb2fe28776157298 Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Sun, 10 Nov 2024 11:49:37 +0500 Subject: [PATCH 10/12] #86 WIP: Move all key bindings into a single subsection --- doc/settings.md | 20 +++++---- src/netxs/desktopio/console.hpp | 2 +- src/netxs/desktopio/terminal.hpp | 2 +- src/vtm.hpp | 2 +- src/vtm.xml | 70 ++++++++++++++++---------------- 5 files changed, 50 insertions(+), 46 deletions(-) diff --git a/doc/settings.md b/doc/settings.md index ea6b3f34fa..761aa148a4 100644 --- a/doc/settings.md +++ b/doc/settings.md @@ -289,13 +289,14 @@ The following configuration items produce the same final result: ### Key bindings -In vtm there are several levels of key combination processing. Each level has its own set of key bindings. Keys processed at the previous level usually do not get to the next level. +In vtm there are several layers of key combination processing. Each layer has its own set of key bindings. Keys processed at the previous layer usually do not get to the next one. -Level | Config section | Description +Layer | Config section | Description -----------------------|------------------------------|------------ -Native GUI window | `` | Native GUI window management key bindings. -Desktop environment | `` | Taskbar and window management key bindings. -Application `app_name` | `` | Application specific key bindings. +Native GUI window | `` | Native GUI window layer key bindings. +TUI matrix | `` | TUI matrix layer key bindings. +Desktop environment | `` | Desktop layer key bindings (taskbar and window management). +Application `app_name` | `` | Application layer key bindings. #### Syntax @@ -341,11 +342,12 @@ Configuration record | Interpretation #### Available actions -Action | Default key combination | Available at level | Description +Action | Default key combination | Available at layer | Description -------------------------------|--------------------------|---------------------|------------ -`Drop` | | All levels | Drop all events for the specified key combination. No further processing. -`DropIfRepeats` | | All levels | Drop `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination. -`ToggleExclusiveKeybd` | `Ctrl-Alt`, `Alt-Ctrl` | Application | Toggle exclusive keyboard mode. In exclusive mode, all keyboard events are ignored by higher levels. Exclusive keyboard mode is automatically disabled when refocusing. +`Drop` | | All layers | Drop all events for the specified key combination. No further processing. +`DropIfRepeats` | | All layers | Drop `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination. +`ToggleDebugOverlay` | | TUI matrix | Toggle debug overlay. +`ToggleExclusiveKeybd` | `Ctrl-Alt`, `Alt-Ctrl` | Application | Toggle exclusive keyboard mode. In exclusive mode, all keyboard events are ignored by higher layers. Exclusive keyboard mode is automatically disabled when refocusing. `IncreaseCellHeight` | `CapsLock+UpArrow` | Native GUI window | Increase the text cell height by one pixel. `DecreaseCellHeight` | `CapsLock+DownArrow` | Native GUI window | Decrease the text cell height by one pixel. `ResetCellHeight` | `Ctrl+Key0` | Native GUI window | Reset text cell height. diff --git a/src/netxs/desktopio/console.hpp b/src/netxs/desktopio/console.hpp index 896a4bdb1f..e7ebaae5b3 100644 --- a/src/netxs/desktopio/console.hpp +++ b/src/netxs/desktopio/console.hpp @@ -1135,7 +1135,7 @@ namespace netxs::ui //auto simple = config.take("/config/simple", faux); // DirectVT Gateway console case. config.set("/config/simple", faux); keybd.proc("ToggleDebugOverlay", [&](hids& gear){ gear.set_handled(); debug ? debug.stop() : debug.start(); }); - keybd.load(config, "/config/debug/hotkeys/key"); + keybd.load(config, "/config/hotkeys/tui/key"); base::root(true); base::limits(dot_11); diff --git a/src/netxs/desktopio/terminal.hpp b/src/netxs/desktopio/terminal.hpp index 7f5f7a9de3..bcec6df0b0 100644 --- a/src/netxs/desktopio/terminal.hpp +++ b/src/netxs/desktopio/terminal.hpp @@ -7747,7 +7747,7 @@ namespace netxs::ui chords.proc("TerminalViewportCopy", [&](hids& gear){ gear.set_handled(); prnscrn(gear); }); chords.proc("TerminalToggleStdioLog", [&](hids& gear){ gear.set_handled(); set_log(!io_log); ondata(); }); chords.proc("ToggleExclusiveKeybd", [&](hids& gear){ if (!gear.is_exclusive()) gear.set_exclusive(This()); else gear.set_exclusive(); }); - chords.load(xml_config, "/config/term/hotkeys/key"); + chords.load(xml_config, "/config/hotkeys/term/key"); LISTEN(tier::general, e2::timer::tick, timestamp) // Update before world rendering. { diff --git a/src/vtm.hpp b/src/vtm.hpp index 37d51d7075..f9efffe447 100644 --- a/src/vtm.hpp +++ b/src/vtm.hpp @@ -739,7 +739,7 @@ namespace netxs::app::vtm keybd.proc("FocusNextWindow", [&](hids& gear){ focus_next_window(gear, feed::fwd); }); keybd.proc("Disconnect", [&](hids& gear){ disconnect(gear); }); keybd.proc("TryToQuit", [&](hids& gear){ try_quit(gear); }); - keybd.load(config, "/config/desktop/hotkeys/key"); + keybd.load(config, "/config/hotkeys/desktop/key"); LISTEN(tier::release, e2::form::upon::vtree::attached, world_ptr) { diff --git a/src/vtm.xml b/src/vtm.xml index c0cd278912..e423d3442a 100644 --- a/src/vtm.xml +++ b/src/vtm.xml @@ -30,20 +30,6 @@ R"==( - - - - - - - - - - - - - - @@ -60,10 +46,6 @@ R"==( - - - - @@ -271,13 +253,6 @@ R"==( - - - - - - - )==" // MSVC2022: C2026 String too big, trailing characters truncated. R"==( @@ -394,7 +369,40 @@ R"==( retry: Restart session if exit code != 0. --> )==" // MSVC2022: C2026 String too big, trailing characters truncated. R"==( - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -428,12 +436,6 @@ R"==( - - - - - - - - + + )==" \ No newline at end of file From a53b652f3637283b0d61b4f0844033de9dc1f408 Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Sun, 10 Nov 2024 11:52:03 +0500 Subject: [PATCH 11/12] v0.9.99.43 --- src/netxs/desktopio/application.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netxs/desktopio/application.hpp b/src/netxs/desktopio/application.hpp index 595925d4bc..305aedf06d 100644 --- a/src/netxs/desktopio/application.hpp +++ b/src/netxs/desktopio/application.hpp @@ -24,7 +24,7 @@ namespace netxs::app namespace netxs::app::shared { - static const auto version = "v0.9.99.42"; + static const auto version = "v0.9.99.43"; static const auto repository = "https://github.com/directvt/vtm"; static const auto usr_config = "~/.config/vtm/settings.xml"s; static const auto sys_config = "/etc/vtm/settings.xml"s; From 0e4ba1c853dfe6b7041cc70de768748af07b885d Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Sun, 10 Nov 2024 11:56:19 +0500 Subject: [PATCH 12/12] Update settings.md --- doc/settings.md | 71 ++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/doc/settings.md b/doc/settings.md index 761aa148a4..b566a4b5bc 100644 --- a/doc/settings.md +++ b/doc/settings.md @@ -451,20 +451,6 @@ Notes - - - - - - - - - - - - - - @@ -481,10 +467,6 @@ Notes - - - - @@ -688,12 +670,6 @@ Notes - - - - - - @@ -806,7 +782,40 @@ Notes close: Always close. restart: Restart session. retry: Restart session if exit code != 0. --> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -838,15 +847,9 @@ Notes - + - - - - - - - - + + ``` \ No newline at end of file