add Ctrl-Tab and Ctrl-Shift-Tab as aliases to ctrl-Right and ctrl-Left (switch tabs), also add wrap around (last->first or first->last).

This commit is contained in:
stefan schippers 2025-08-21 10:23:58 +02:00
parent d778a738b2
commit 07e79908f1
4 changed files with 42 additions and 0 deletions

View File

@ -128,6 +128,8 @@ ctrl Enter Confirm closing dialog boxes
- Up Move up
ctrl Left Previous tab (if tabbed interface enabled)
ctrl Right Next tab (if tabbed interface enabled)
ctrl+shift Tab Previous tab (if tabbed interface enabled)
ctrl Tab Next tab (if tabbed interface enabled)
- ':' Toggle flat netlist
- '\' Toggle fullscreen
- '!' Break selected wires at any wire or component pin

View File

@ -3799,6 +3799,26 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
}
break;
case XK_Tab:
if(state == ControlMask) {
int save = xctx->semaphore;
if(xctx->semaphore >= 2) break;
xctx->semaphore = 0;
tcleval("next_tab");
xctx->semaphore = save;
}
break;
case XK_ISO_Left_Tab:
if(state == (ControlMask | ShiftMask)) {
int save = xctx->semaphore;
if(xctx->semaphore >= 2) break;
xctx->semaphore = 0;
tcleval("prev_tab");
xctx->semaphore = save;
}
break;
case XK_Right:
if(state == ControlMask) {
int save = xctx->semaphore;

View File

@ -69,6 +69,8 @@ ctrl Enter Confirm closing dialog boxes
- Up Move up
ctrl Left Previous tab (if tabbed interface enabled)
ctrl Right Next tab (if tabbed interface enabled)
ctrl+shift Tab Previous tab (if tabbed interface enabled)
ctrl Tab Next tab (if tabbed interface enabled)
- ':' Toggle flat netlist
- '\' Toggle fullscreen
- '!' Break selected wires at any wire or component pin

View File

@ -8195,19 +8195,28 @@ proc prev_tab {} {
regsub {\.drw} $currwin {} tabname
if {$tabname eq {}} { set tabname .x0}
regsub {\.x} $tabname {} number
set found 0
set next_tab $number
set wrap_tab $number
set highest -10000000
set highest_all -10000000
set xcoord [winfo rootx .tabs$tabname]
for {set i 0} {$i < $tctx::max_new_windows} { incr i} {
if { $i == $number} { continue}
if { [winfo exists .tabs.x$i] } {
set tab_coord [winfo rootx .tabs.x$i]
if {$tab_coord < $xcoord && $tab_coord > $highest} {
set found 1
set next_tab $i
set highest $tab_coord
}
if {$tab_coord > $highest_all} {
set highest_all $tab_coord
set wrap_tab $i
}
}
}
if {$found == 0} { set next_tab $wrap_tab}
.tabs.x$next_tab invoke
}
@ -8218,19 +8227,28 @@ proc next_tab {} {
regsub {\.drw} $currwin {} tabname
if {$tabname eq {}} { set tabname .x0}
regsub {\.x} $tabname {} number
set found 0
set next_tab $number
set wrap_tab $number
set lowest 10000000
set lowest_all 10000000
set xcoord [winfo rootx .tabs$tabname]
for {set i 0} {$i < $tctx::max_new_windows} { incr i} {
if { $i == $number} { continue}
if { [winfo exists .tabs.x$i] } {
set tab_coord [winfo rootx .tabs.x$i]
if {$tab_coord > $xcoord && $tab_coord < $lowest} {
set found 1
set next_tab $i
set lowest $tab_coord
}
if {$tab_coord < $lowest_all} {
set lowest_all $tab_coord
set wrap_tab $i
}
}
}
if {$found == 0} { set next_tab $wrap_tab}
.tabs.x$next_tab invoke
}