updated moude_bindings.tcl with Paul`s new version, updated noconn.sym (do not use *_ignore attributes, put comments in netlist about NC net)

This commit is contained in:
stefan schippers 2023-06-30 09:11:04 +02:00
parent 6755975369
commit f8f7c4f230
2 changed files with 98 additions and 36 deletions

View File

@ -1,55 +1,116 @@
################################################################################ ################################################################################
# $Id: mouse_bindings.tcl,v 1.3 2023/06/26 21:00:11 paul Exp $ # $Id: mouse_bindings.tcl,v 1.6 2023/06/29 23:44:15 paul Exp $
# #
# $env(HOME)/.xschem/mouse_bindings.tcl # $env(HOME)/.xschem/mouse_bindings.tcl
# #
# The purpose of this code is to configure custom mouse button bindings for # The purpose of this code is to configure custom mouse button bindings for
# mice that have more buttons than the conventional 3 buttons and scroll wheel. # mice that have more buttons than the conventional 3 buttons and scroll wheel.
# This code also works to reconfigure bindings for conventional mice. # This code also works to reconfigure bindings for conventional mice. In my
# case, my mouse has 2 extra buttons that X11 has identified as 8 & 9.
# #
# INSTRUCTIONS: # INSTRUCTIONS:
# 1. use linux command 'xev -event button' to find the X11 mouse button ID # 1. use linux command 'xev -event button' to find the X11 mouse button ID
# number for any mouse button. # number for any mouse button.
# 2. modify 'proc mouse_buttons' below to define an action for the button # 2. modify 'proc mouse_buttons' below to define an action for the button
# along with optional key modifier(s). # along with optional key modifier(s).
# 3. add the following line to user xschemrc file: # 3. add the following line to user xschemrc file:
# lappend tcl_files $env(HOME)/.xschem/mouse_bindings.tcl # lappend tcl_files $env(HOME)/.xschem/mouse_bindings.tcl
# #
################################################################################ ################################################################################
################################################################################ ################################################################################
# PARAMETERS of proc mouse_buttons { b m }: # PARAMETERS of proc mouse_buttons { b m }:
# NOTE THAT BIT 4 OF $m IS ALWAYS SET SO $m >= 16 # NOTE BITS 1,4,5 (Cap-Lock,Num-Lock,Undefined) Need to be cleared
# NOTE THAT THE 'OR' OF ALL MODIFIER KEYS = 0x4f # NOTE THAT THE 'OR' OF ALL MODIFIER KEYS = 0x4f
# $m: modifier key(s) # $m: modifier: bit# bitval
# No Modifier: 0 # No Modifier: - 0
# Shift: 1 # Shift: 0 1
# Caps-Lock: 2 # Cap-Lock: 1 2
# Control: 4 # Control: 2 4
# Alt: 8 # Alt: 3 8
# Num-Lock: 16 # Num-Lock: 4 16
# Win key: 64 # Mod3: 5 32 (not mapped to any key on PC keyboards)
# To encode multiple modifiers simply add the corresponding modifier numbers # Win key: 6 64
# To encode multiple modifiers simply add the corresponding modifier bitvals
# $b: mouse button: 1..9 # $b: mouse button: 1..9
################################################################################ ################################################################################
proc mouse_buttons { b m } { proc mouse_buttons { b m } {
# filter out Caps-Lock and Num-Lock status # filter out Cap-Lock, Num-Lock, and Undefined keys
set m [ expr { $m & ~(16+2) } ] set m [ expr { $m & ~(2+16+32) } ]
# puts "modifier state: $m" # puts "modifier state: $m"
switch $m { switch $m {
0 { switch $b { # None
8 { xschem zoom_full center } 0 { switch $b {
9 { xschem unhilight_all } } } 8 { xschem zoom_full center }
1 { switch $b { 9 { xschem unhilight_all } } }
8 { xschem set_modify 1; xschem save } } } # Shift
} 1 { switch $b {
8 { xschem set_modify 1; xschem save }
9 { } } }
# Cntl
4 { switch $b {
8 { }
9 { } } }
# Shift+Cntl
5 { switch $b {
8 { }
9 { } } }
# Alt
8 { switch $b {
8 { }
9 { } } }
# Shift+Alt
9 { switch $b {
8 { }
9 { } } }
# Cntl+Alt
12 { switch $b {
8 { }
9 { } } }
# Shift+Cntl+Alt
13 { switch $b {
8 { }
9 { } } }
# Winkey
64 { switch $b {
8 { }
9 { } } }
# Shift+Winkey
65 { switch $b {
8 { }
9 { } } }
# Cntl+Winkey
68 { switch $b {
8 { }
9 { } } }
# Shift+Cntl+Winkey
69 { switch $b {
8 { }
9 { } } }
# Alt+Winkey
72 { switch $b {
8 { }
9 { } } }
# Shift+Alt+Winkey
73 { switch $b {
8 { }
9 { } } }
# Cntl+Alt+Winkey
76 { switch $b {
8 { }
9 { } } }
# Shift+Cntl+Alt+Winkey
77 { switch $b {
8 { }
9 { } } }
}
} }
# the global variable 'has_x' is provided by xschem. It is defined to '1' # the global variable 'has_x' is provided by xschem. It is defined to '1'
# if graphics has been initialized. # if graphics has been initialized.
if { [ info exists has_x ] } { if { [ info exists has_x ] } {
# puts "Loading ~/.xschem/mouse_bindings.tcl" # puts "Loading ~/.xschem/mouse_bindings.tcl"
bind .drw <Any-Button> {+mouse_buttons %b %s} bind .drw <Any-Button> {+mouse_buttons %b %s}
} }

View File

@ -1,10 +1,11 @@
v {xschem version=2.9.8 file_version=1.2} v {xschem version=3.4.1 file_version=1.2
}
G {} G {}
K {type=noconn K {type=noconn
format="* noconn " format="* noconn @#0:net_name"
vhdl_ignore=true vhdl_format="-- noconn @#0:net_name"
verilog_ignore=true verilog_format="// noconn @#0:net_name"
spice_ignore=true tedax_format="# noconn @#0:net_name"
template="name=l1"} template="name=l1"}
V {} V {}
S {} S {}