removed unneeded Shift-Backspace and Ctrl-Backspace keybindings, add Ctrl-Shift-T for open last closed (Ctrl-Shift-O already opens most recent). Tcl var "open_in_new_window" will open in new tab/windows as does ctrl-o

This commit is contained in:
stefan schippers 2025-09-29 23:30:31 +02:00
parent 50c593ed65
commit 15c141a480
7 changed files with 26 additions and 27 deletions

View File

@ -116,8 +116,6 @@ LeftButton Double click Terminate Polygon placement
XSCHEM KEY BINDINGS
----------------------------------------------------------------------
- BackSpace Back to parent schematic
shift BackSpace Open last closed schematic
ctrl BackSpace Open last opened or saved schematic
- Delete Delete selected objects
- Insert Insert element from library
shift Insert Open persistent insert symbol dialog box
@ -242,6 +240,7 @@ ctrl+alt 's' Save-as symbol
- 't' Place text
ctrl 't' create new tab or window
shift 'T' Toggle *_ignore flag on selected instances
shift+ctrl 'T' Load last closed file
alt 'u' Align to current grid selected objects
ctrl 'u' Unselect attached floater objects
shift 'U' Redo

View File

@ -1055,7 +1055,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
open file or opening a new(not existing) file.
'-noundoreset': do not reset the undo history
'-lastclosed': open last closed file
'-lastcopened': open last opened file
'-lastopened': open last opened file
'-nosymbols': do not load symbols (used if loading a symbol instead of
a schematic)
'-nofullzoom': do not do a full zoom on new schematic.

View File

@ -3221,7 +3221,13 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
case 'O':
if(rstate == ControlMask ) { /* load most recent tile */
tclvareval("xschem load -gui [lindex $tctx::recentfile 0]", NULL);
xctx->semaphore--;
if(tclgetboolvar("open_in_new_window")) {
tclvareval("xschem load_new_window -lastopened", NULL);
} else {
tclvareval("xschem load -gui -lastopened", NULL);
}
xctx->semaphore++;
}
else if(rstate == 0) { /* toggle light/dark colorscheme 20171113 */
int d_c;
@ -3469,6 +3475,16 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
if(rstate == 0) { /* toggle spice_ignore, verilog_ignore, ... flag on selected instances. */
toggle_ignore();
}
else if(rstate == ControlMask ) { /* load last closed */
xctx->semaphore--;
if(tclgetboolvar("open_in_new_window")) {
tclvareval("xschem load_new_window -lastclosed", NULL);
} else {
tclvareval("xschem load -gui -lastclosed", NULL);
}
xctx->semaphore++;
}
break;
case 'u':
@ -3927,21 +3943,6 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
case XK_BackSpace:
if(xctx->semaphore >= 2) break;
if(state == 0) go_back(1); /* go up in hierarchy */
else if(state == ShiftMask) {
/* load last closed file */
char f[PATH_MAX];
xctx->semaphore--;
my_strncpy(f, tcleval("get_lastclosed"), S(f));
ask_new_file(1, f);
xctx->semaphore++;
} else if(state == ControlMask) {
/* load last opened file */
char f[PATH_MAX];
xctx->semaphore--;
my_strncpy(f, tcleval("get_lastopened"), S(f));
ask_new_file(1, f);
xctx->semaphore++;
}
break;
#if defined(__unix__) && HAS_CAIRO==1

View File

@ -57,8 +57,6 @@ LeftButton Double click Terminate Polygon placement
XSCHEM KEY BINDINGS
----------------------------------------------------------------------
- BackSpace Back to parent schematic
shift BackSpace Open last closed schematic
ctrl BackSpace Open last opened or saved schematic
- Delete Delete selected objects
- Insert Insert element from library
shift Insert Open persistent insert symbol dialog box
@ -183,6 +181,7 @@ ctrl+alt 's' Save-as symbol
- 't' Place text
ctrl 't' create new tab or window
shift 'T' Toggle *_ignore flag on selected instances
shift+ctrl 'T' Load last closed file
alt 'u' Align to current grid selected objects
ctrl 'u' Unselect attached floater objects
shift 'U' Redo

View File

@ -2997,7 +2997,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
* open file or opening a new(not existing) file.
* '-noundoreset': do not reset the undo history
* '-lastclosed': open last closed file
* '-lastcopened': open last opened file
* '-lastopened': open last opened file
* '-nosymbols': do not load symbols (used if loading a symbol instead of
* a schematic)
* '-nofullzoom': do not do a full zoom on new schematic.

View File

@ -9267,8 +9267,10 @@ proc build_widgets { {topwin {} } } {
$topwin.menubar.file add command -label "Open" -command "xschem load" -accelerator {Ctrl+O}
$topwin.menubar.file add command -label "Open in new window" -command "xschem load_new_window" \
-accelerator {Alt+O}
$topwin.menubar.file add command -label "Open Most Recent" \
-command {xschem load -gui [lindex "$tctx::recentfile" 0]} -accelerator {Ctrl+Shift+O}
$topwin.menubar.file add command -label "Open last closed" \
-command {xschem load -gui -lastclosed} -accelerator {Ctrl+Shift+T}
$topwin.menubar.file add command -label "Open most recent" \
-command {xschem load -gui -lastopened} -accelerator {Ctrl+Shift+O}
$topwin.menubar.file add cascade -label "Open recent" -menu $topwin.menubar.file.recent
menu $topwin.menubar.file.recent -tearoff 0 -takefocus 0
setup_recent_menu $topwin

View File

@ -299,7 +299,7 @@ T {New win/tab} 442.5 -275 0 0 0.18 0.18 {layer=4}
T {Toggle ignore} 442.5 -263.75 0 0 0.18 0.18 {layer=12}
T {Text} 442.5 -252.5 0 0 0.18 0.18 {}
T {-} 442.5 -286.25 0 0 0.18 0.18 {layer=7}
T {-} 442.5 -297.5 0 0 0.18 0.18 {layer=6}
T {Opn.Last closed} 442.5 -297.5 0 0 0.18 0.18 {layer=6}
T {Unsel floaters} 602.5 -275 0 0 0.18 0.18 {layer=4}
T {Redo} 602.5 -263.75 0 0 0.18 0.18 {layer=12}
T {Undo} 602.5 -252.5 0 0 0.18 0.18 {}
@ -471,5 +471,3 @@ T {Move down} 1302.5 -12.5 0 0 0.18 0.18 {}
T {Move up} 1302.5 -92.5 0 0 0.18 0.18 {}
T {Open last file} 762.5 -297.5 0 0 0.18 0.18 {layer=6}
T {Previous Tab} 2.5 -275 0 0 0.18 0.18 {layer=4}
T {Load last opened file} 1042.5 -355 0 0 0.18 0.18 {layer=4}
T {Load last closed file} 1042.5 -343.75 0 0 0.18 0.18 {layer=12}