Skip to content

Commit f39d06d

Browse files
authored
Merge pull request #814 from o-sdn-o/gui-bridge
Make Alt+Z binding only for desktop mode (and only on non-Windows platforms)
2 parents da9281b + 70f27d9 commit f39d06d

File tree

6 files changed

+52
-37
lines changed

6 files changed

+52
-37
lines changed

doc/settings.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ Notes
902902
</autorun>
903903
<width> <!-- Taskbar menu width. -->
904904
<folded=18/>
905-
<expanded=40/>
905+
<expanded=41/>
906906
</width>
907907
<timeout=250ms/> <!-- Taskbar collaplse timeout after mouse leave. -->
908908
<colors>
@@ -1029,9 +1029,10 @@ Notes
10291029
<script=RollFontsForward on="Ctrl+Shift+F12" />
10301030
<script=ResetWheelAccumulator on="preview:-Ctrl" />
10311031
<script=ToggleDebugOverlay on="Space-Backspace | Backspace-Space"/>
1032-
<script=FocusTaskbar on="Esc+F1 | Alt+Z" />
10331032
</gate>
10341033
<desktop script*> <!-- Desktop bindings. -->
1034+
<script=FocusTaskbar on="Esc+F1" />
1035+
<script=FocusTaskbar on="Alt+Z" />
10351036
<script=FocusPrevWindow on="Ctrl+PageUp" />
10361037
<script=FocusNextWindow on="Ctrl+PageDown"/>
10371038
<script=Disconnect on="Shift+F7" />

doc/user-interface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</tr>
2424
</thead>
2525
<tbody>
26-
<tr><th>Esc+F1 ¹ / Alt+Z</th> <td colspan="9">Focus taskbar</td></tr>
26+
<tr><th>Esc+F1 ¹ (Alt+Z on non-Windows platforms)</th> <td colspan="9">Focus taskbar</td></tr>
2727

2828
<tr><th>Esc | Alt</th> <td colspan="3">Unfocus taskbar</td><td colspan="6"></td></tr>
2929
<tr><th>LeftArrow</th> <td colspan="3">Focus left item</td><td colspan="6"></td></tr>

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 = "v2025.09.23";
25+
static const auto version = "v2025.09.24";
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/gui.hpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3199,13 +3199,16 @@ namespace netxs::gui
31993199
}
32003200
auto changed = std::exchange(keymod, state) != keymod || synth;
32013201
auto& gear = *stream.gears;
3202-
if ((changed || gear.ctlstat != keymod) && stream.m.enabled == hids::stat::ok)
3202+
if ((changed || gear.ctlstat != keymod))
32033203
{
32043204
gear.ctlstat = keymod;
3205-
stream.m.ctlstat = keymod;
3206-
stream.m.timecod = datetime::now();
3207-
stream.m.changed++;
3208-
stream.mouse(stream.m); // Fire mouse event to update kb modifiers.
3205+
if (stream.m.enabled == hids::stat::ok)
3206+
{
3207+
stream.m.ctlstat = keymod;
3208+
stream.m.timecod = datetime::now();
3209+
stream.m.changed++;
3210+
stream.mouse(stream.m); // Fire mouse event to update kb modifiers.
3211+
}
32093212
}
32103213
gear.payload = input::keybd::type::keypress;
32113214
gear.extflag = extflag;

src/netxs/desktopio/system.hpp

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5043,13 +5043,16 @@ namespace netxs::os
50435043
else if (modstat.changed)
50445044
{
50455045
k.ctlstat = kbmod;
5046-
m.ctlstat = kbmod;
5047-
m.hzwheel = faux;
5048-
m.wheelfp = 0;
5049-
m.wheelsi = 0;
5050-
m.timecod = datetime::now();
5051-
m.changed++;
5052-
mouse(m); // Fire mouse event to update kb modifiers.
5046+
if (m.enabled == input::hids::stat::ok)
5047+
{
5048+
m.ctlstat = kbmod;
5049+
m.hzwheel = faux;
5050+
m.wheelfp = 0;
5051+
m.wheelsi = 0;
5052+
m.timecod = datetime::now();
5053+
m.changed++;
5054+
mouse(m); // Fire mouse event to update kb modifiers.
5055+
}
50535056
}
50545057
if (utf::to_code(r.Event.KeyEvent.uChar.UnicodeChar, point))
50555058
{
@@ -5117,7 +5120,6 @@ namespace netxs::os
51175120
m.timecod = datetime::now();
51185121
m.enabled = input::hids::stat::halt; // Send a mouse halt event.
51195122
mouse(m);
5120-
m.enabled = input::hids::stat::ok;
51215123
}
51225124
break;
51235125
case nt::console::event::style:
@@ -5172,6 +5174,7 @@ namespace netxs::os
51725174
{
51735175
m.changed++;
51745176
m.timecod = datetime::now();
5177+
m.enabled = input::hids::stat::ok;
51755178
mouse(m);
51765179
}
51775180
}
@@ -5181,6 +5184,7 @@ namespace netxs::os
51815184
{
51825185
m.changed++;
51835186
m.timecod = datetime::now();
5187+
m.enabled = input::hids::stat::ok;
51845188
mouse(m);
51855189
}
51865190
}
@@ -5821,16 +5825,9 @@ namespace netxs::os
58215825
});
58225826
m.changed++;
58235827
m.timecod = datetime::now();
5824-
if (std::isnan(m.coordxy.x))
5825-
{
5826-
m.enabled = input::hids::stat::halt; // Send a mouse halt event.
5827-
mouse(m);
5828-
m.enabled = input::hids::stat::ok;
5829-
}
5830-
else
5831-
{
5832-
mouse(m);
5833-
}
5828+
m.enabled = std::isnan(m.coordxy.x) ? input::hids::stat::halt // Send a mouse halt event.
5829+
: input::hids::stat::ok;
5830+
mouse(m);
58345831
}
58355832
else if (t == type::mouse) // SGR mouse report: ESC [ < ctrl ; xpos ; ypos M
58365833
{
@@ -5853,7 +5850,7 @@ namespace netxs::os
58535850
auto ctl = ctrl.value();
58545851

58555852
m.timecod = timecode;
5856-
m.enabled = {};
5853+
m.enabled = input::hids::stat::ok;
58575854
m.hzwheel = {};
58585855
m.wheelfp = {};
58595856
m.wheelsi = {};
@@ -5996,13 +5993,16 @@ namespace netxs::os
59965993
if (k.ctlstat != kbmod)
59975994
{
59985995
k.ctlstat = kbmod;
5999-
m.ctlstat = kbmod;
6000-
m.hzwheel = faux;
6001-
m.wheelfp = 0;
6002-
m.wheelsi = 0;
6003-
m.timecod = datetime::now();
6004-
m.changed++;
6005-
mouse(m); // Fire mouse event to update kb modifiers.
5996+
if (m.enabled == input::hids::stat::ok)
5997+
{
5998+
m.ctlstat = kbmod;
5999+
m.hzwheel = faux;
6000+
m.wheelfp = 0;
6001+
m.wheelsi = 0;
6002+
m.timecod = datetime::now();
6003+
m.changed++;
6004+
mouse(m); // Fire mouse event to update kb modifiers.
6005+
}
60066006
}
60076007
}
60086008
parser(data);
@@ -6095,6 +6095,7 @@ namespace netxs::os
60956095
m.coordxy = mcoord / scale;
60966096
m.buttons = bttns;
60976097
m.ctlstat = k.ctlstat;
6098+
m.enabled = input::hids::stat::ok;
60986099
if (wheelfp)
60996100
{
61006101
if (wheelfp.x)

src/vtm.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ R"==(
113113
</autorun>
114114
<width> <!-- Taskbar menu width. -->
115115
<folded=18/>
116-
<expanded=40/>
116+
<expanded=41/>
117117
</width>
118118
<timeout=250ms/> <!-- Taskbar collaplse timeout after mouse leave. -->
119119
<colors>
@@ -244,9 +244,19 @@ R"==(
244244
<script=RollFontsForward on="Ctrl+Shift+F12" />
245245
<script=ResetWheelAccumulator on="preview:-Ctrl" />
246246
<script=ToggleDebugOverlay on="Space-Backspace | Backspace-Space"/>
247-
<script=FocusTaskbar on="Esc+F1 | Alt+Z" />
248247
</gate>
249248
<desktop script*> <!-- Desktop bindings. -->
249+
)=="
250+
#if defined (WIN32)
251+
R"==(
252+
<script=FocusTaskbar on="Esc+F1" />
253+
)=="
254+
#else
255+
R"==(
256+
<script=FocusTaskbar on="Alt+Z" />
257+
)=="
258+
#endif
259+
R"==(
250260
<script=FocusPrevWindow on="Ctrl+PageUp" />
251261
<script=FocusNextWindow on="Ctrl+PageDown"/>
252262
<script=Disconnect on="Shift+F7" />

0 commit comments

Comments
 (0)