6 (use-modules (gschem deprecated))
9 ; keywords are case sensitive (guile feature)
10 ; mode strings are case sensitive
11 ; colors are not case sensitive
14 ; gschem-version string
16 ; Specifies the version of this file. This number is used to make sure
17 ; that the rc file is compatible with the version of gschem that is
18 ; being run. The end user should *not* change this value.
20 (gschem-version "@DATE_VERSION@")
22 (load-from-path "gschem-deprecated-config.scm")
25 ; Start of color section
28 ;; Make the gschem color maps more user-friendly
29 (color-map-make-friendly display-color-map)
30 (color-map-make-friendly display-outline-color-map)
32 ; Load up a color scheme which has a dark (black) background.
33 ; Comment out the first line and comment in the second line for a
34 ; light (almost white) background. The dark background is the
37 (primitive-load (build-path geda-rc-path "gschem-colormap-darkbg")) ; dark background
38 ;(load (build-path geda-rc-path "gschem-colormap-whitebg")) ; light background
39 ;(load (build-path geda-rc-path "gschem-colormap-whitebg-bw")) ; light background, bw
40 ;(load (build-path geda-rc-path "gschem-colormap-lightbg")) ; shaded background
41 ;(load (build-path geda-rc-path "gschem-colormap-bw")) ; shaded background, bw
44 ; End of color section
48 ; Start of mode related keywords
53 ; Controls if the toolbars are visible or not.
56 ;(toolbars "disabled")
60 ; Controls if the handleboxes (which contain the menu and toolbar) are
63 (handleboxes "enabled")
64 ;(handleboxes "disabled")
68 ; Controls if the undo is enabled or not
70 (undo-control "enabled")
71 ;(undo-control "disabled")
75 ; Determines the number of levels of undo. Basically this number decides
76 ; how many backup schematics are saved on disk.
82 ; Controls which kind of undo is used. The default is to use the disk as
83 ; the storing medium (ie after every action the undo information is stored
84 ; to disk). The other mechanism uses only memory. The disk mechanism is
85 ; nice because you get undo-level number of backups of the schematic written
86 ; to disk as backups so you should never lose a schematic due to a crash.
93 ; Controls if pan or zoom commands are saved in the undo list. If this
94 ; is enabled then a pan or zoom command will be considered a command and
95 ; can be undone. If this is false, then panning and zooming is not saved
96 ; in the undo list and cannot be undone. Note, the current viewport
97 ; information is saved for every command, so the display will change to the
98 ; viewport before a command is executed.
100 (undo-panzoom "enabled")
101 ;(undo-panzoom "disabled")
106 ; Controls if a backup copy is made every "interval" seconds.
107 ; Note that the backup copy is made when you make some change to the schematic,
108 ; and there were more than "interval" seconds from the last autosave.
109 ; Autosaving will not be allowed if setting it to zero.
110 (auto-save-interval 120)
114 ; Controls if the editing grips are drawn when selecting objects
116 (draw-grips "enabled")
117 ;(draw-grips "disabled")
119 ; net-direction-mode string
121 ; Controlls if the net direction mode is used. This mode tries to guess
122 ; the best continuation direction of a L-shape net when adding a net.
124 (net-direction-mode "enabled")
125 ;(net-direction-mode "disabled")
127 ; net-selection-mode string
129 ; Controls how many net segments are selected when you click at a net
130 ; If one of the enabled items is used, the selection state will toggle
131 ; through all selection states. The mode defines the maximum search depth
132 ; for the net selection mode
134 ;(net-selection-mode "disabled")
135 (net-selection-mode "enabled_net")
136 ;(net-selection-mode "enabled_all")
138 ; net-consolidate string
140 ; Controls if the net consolidation code is used when schematics are read
141 ; in, written to disk, and when nets are being drawn (does not consolidate
142 ; when things are being copied or moved yet). Net consolidation is the
143 ; connection of nets which can be combined into one.
144 ; Comment out if you want the default mode
146 (net-consolidate "enabled")
147 ;(net-consolidate "disabled")
149 ; netconn-rubberband string
151 ; Controls if net connections are maintained when you move a connecting
154 (netconn-rubberband "enabled")
155 ;(netconn-rubberband "disabled")
157 ; magnetic-net-mode string
159 ; Controls the initial setting of the magnetic net mode. The magnetic
160 ; net mode marks a possible connection that is close to the current
162 (magnetic-net-mode "enabled")
163 ;(magnetic-net-mode "disabled")
165 ; zoom-with-pan string
167 ; Sets the zoom in and zoom out functions to pan the display and then zoom.
168 ; Basically zoom in / out where the mouse pointer sits on the display.
169 ; Comment out if you want the default mode.
171 (zoom-with-pan "enabled")
172 ;(zoom-with-pan "disabled")
176 ; Controls the percentage size increase when zooming into the page.
177 ; Un-zooming uses the inverse factor such that a zoom in / zoom out
178 ; pair will return the schematic to the same size.
180 ; 20% increment => x 1.2 original size when zooming in
181 ; => x 1 / 1.2 x original size when zooming out
184 ;(zoom-gain 50) ; Hard-coded behaviour up to version 1.5.0.20080706
186 ; fast-mousepan string
188 ; Controls if text is drawn properly or if a simplified version (a line which
189 ; represents the text string) is drawn during mouse pan. Drawing a simple
190 ; line speeds up mousepan a lot for big schematics
191 (fast-mousepan "enabled")
192 ;(fast-mousepan "disabled")
194 ; mousepan-gain integer
196 ; Controls how much the display pans when using mousepan. A larger value
197 ; provides greater pan distance when moving the mouse, while a smaller value
198 ; provides a smoother, but smaller pan distance when moving the mouse.
203 ; keyboardpan-gain integer
205 ; Controls how much the display pans when using the keyboard cursor keys.
206 ; A larger value provides greater pan distance when pressing the cursor
207 ; keys, while a smaller value provides a smoother, but smaller pan
208 ; distance when moving the cursor keys.
209 (keyboardpan-gain 20)
210 ;(keyboardpan-gain 10)
211 ;(keyboardpan-gain 1)
212 ;(keyboardpan-gain 5)
214 ; select-slack-pixels integer
216 ; Controls how many pixels around an object can still be clicked as part of
218 ; A larger value gives greater ease in selecting small, or narrow objects.
219 (select-slack-pixels 10)
220 ;(select-slack-pixels 4)
221 ;(select-slack-pixels 0)
222 ;(select-slack-pixels 1)
225 ; action-feedback-mode string
227 ; Set the default action feedback mode (for copy/move/component place).
228 ; Set to outline to get an outline of the selection.
229 ; Set to boundingbox to get a bounding box of the selection.
230 ; For a fast machines with fast video use outline (it looks good).
231 ; For a slow machine use boundingbox; it is much faster.
232 ; Comment out if you want the default mode.
234 (action-feedback-mode "outline")
235 ;(action-feedback-mode "boundingbox")
237 ; continue-component-place string
239 ; If this enabled then multiple instances of the same component can be placed
240 ; immediately without having to click on the name or Apply in the Component
241 ; Place... dialog box. If this is disabled then only one component can be
242 ; placed (the user must then press Apply in the dialog box to place multiple
243 ; instances of the same component)
245 (continue-component-place "enabled")
246 ;(continue-component-place "disabled")
250 ; Controls if the scrollbars are displayed (enabled) or not (disabled)
251 ; If you disable the scrollbars, you will not be able to use the scroll
252 ; wheel on your mouse. This is an unfortunate side effect of how the
253 ; code is implemented.
255 (scrollbars "enabled")
256 ;(scrollbars "disabled")
258 ; raise-dialog-boxes-on-expose string
260 ; Controls if dialog boxes are raised whenever an expose event happens
261 ; Default is disabled since gtk2 supposedly handles the raising of these
262 ; dialogs correctly now.
264 ;(raise-dialog-boxes-on-expose "enabled")
265 (raise-dialog-boxes-on-expose "disabled")
267 ; embed-components string
269 ; Determines if the newly placed components are embedded in the schematic
270 ; or if only the filename is specified and the component is searched for
271 ; instead. If it is enabled, then all new components will be embedded
272 ; otherwise they are not embedded. This can be controlled on the fly during
273 ; runtime with the "Embed Component" checkbox on the select component dialog
276 ;(embed-components "enabled")
277 (embed-components "disabled")
281 ; Determines if the logging mechanism is enabled or disabled
282 ; Possible options: enabled or disabled
283 ; Default is enabled.
284 ; See below for the logging-destination keyword for control over
285 ; where the messages go.
288 ;(logging "disabled")
293 ; Controls if the log message window is mapped when gschem is started up
295 ; startup - opened up when gschem starts
296 ; later - NOT opened up when gschem starts
297 ; (can be opened by Options/Show Log Window)
299 ;(log-window "startup")
303 ; log-window-type string
305 ; Controls if the log message window is a transient or if it is decorated
306 ; as a normal window (this is dependant on the window manager doing decoration
310 ; decorated - log window is a normal decorated window
311 ; transient - log window is a transient dialog box, typically
312 ; not decorated by the window manager
314 (log-window-type "decorated")
315 ;(log-window-type "transient")
318 ; logging-destination string
320 ; Specifies where log message go during run time.
321 ; Possible options are:
322 ; log_window The log window (if it's visible)
323 ; tty The stdout of the terminal where gschem was run from
324 ; both Both of the above locations
325 ; Message are always written to the log file (unless logging is disabled)
326 ; by the above keyword
328 ; Default is log_window
330 (logging-destination "log_window")
331 ;(logging-destination "tty")
332 ;(logging-destination "both")
336 ; Sets the default text size.
342 ; Sets the default grid spacing at start-up of gschem.
346 ; text-caps-style string
348 ; Sets the default caps style used for the input of text
349 ; lower specifies that all inputed text is in lowercase
350 ; upper specifies that all inputed text is in uppercase
351 ; both specifies that all inputed text is used as is (no case conversion)
353 (text-caps-style "both")
354 ;(text-caps-style "lower")
355 ;(text-caps-style "upper")
357 ; file-preview string
359 ; Controls if the preview area in the File Open/Save As and Component
360 ; dialog boxes is enabled by default or not
362 (file-preview "enabled")
363 ;(file-preview "disabled")
365 ; enforce-hierarchy string
367 ; Controls if the movement between hierarchy levels (of the same underlying
368 ; schematics) is allowed or not.
369 ; If this is enabled, then the user cannot (without using the page manager)
370 ; move between hierarchy levels otherwise, if enabled, the user sees all
371 ; the hierarchy levels as being flat.
373 (enforce-hierarchy "enabled")
374 ;(enforce-hierarchy "disabled")
376 ; world-size width height border
378 ; Specifies the size of the world and a border (in world space units)
379 ; Be sure all inputs are reals (floats/doubles) and don't try to reverse
380 ; the values: to get a portrait mode. Code to support that needs to be added
381 ; The code that implements this automatically transforms the dimensions into
382 ; the proper aspect ratio. All units are in inches.
383 ; This is not the paper size. That is specified elsewhere. End users should
384 ; not change this at all.
386 (world-size 120.0 90.0 1.0)
387 ;(world-size 60.0 45.0 1.0)
391 ; Controls if image (png) is color (enabled) or black/white (disabled)
393 (image-color "enabled")
394 ;(image-color "disabled")
396 ; middle-button string
398 ; Controls if the middle mouse button draws strokes, repeats the last
399 ; command, does an action (move and copy (holding down the ALT key)
400 ; are supported) on a single objects, or if it does the mouse panning.
402 (middle-button "mousepan")
403 ;(middle-button "action")
404 ;(middle-button "stroke")
405 ;(middle-button "repeat")
407 ; third-button string
409 ; Controls if the third mouse button performs the popup ("popup") or
410 ; if it does the mouse panning ("mousepan")
412 (third-button "popup")
413 ;(third-button "mousepan")
415 ; third-button-cancel string
417 ; Controls if the third mouse in mousepan mode cancels draw actions such as
418 ; placing of a component or drawing of a primitive
420 (third-button-cancel "enabled")
421 ;(third-button-cancel "disabled")
423 ; scroll-wheel string
425 ; Controls the binding of the mouse scroll wheel.
426 ; "classic" style is the gschem default, where scrolling with no modifier
427 ; key is mapped to zoom, + CTRL -> x-axis pan, + SHIFT -> y-axis pan.
428 ; "gtk" style changes the behaviour to be more like other GTK applications,
429 ; no modifier -> y-axis pan, + CTRL -> zoom, + SHIFT -> x-axis pan.
430 (scroll-wheel "classic")
431 ;(scroll-wheel "gtk")
434 ; scrollpan-steps integer
436 ; Controls the number of scroll pan events required to traverse the viewed
437 ; schematic area. Larger numbers mean more scroll steps are required to
438 ; pan across the viewed area and giving finer control over positioning.
440 ;(scrollpan-steps 4) ; Hard-coded behaviour up to version 1.5.0.20080706
444 ; Controls if the cursor is warped (or moved) when you zoom in and out.
445 ; Some people find this forced cursor movement annoying.
447 (warp-cursor "enabled")
448 ;(warp-cursor "disabled")
451 ; Bus ripper controls
452 ; The following keywords control the auto bus ripper addition code
454 ; bus-ripper-size : Sets the size of the auto bus rippers.
455 ; bus-ripper-type : Sets the bus ripper type either a "component" or
457 ; bus-ripper-symname : If above is set to component, specify the symbol name.
458 ; The symbol must exist in a component library
461 ; The default bus ripper
462 (bus-ripper-size 200)
463 (bus-ripper-type "component")
464 (bus-ripper-symname "busripper-1.sym")
466 ; A symmetric alternative
467 ;(bus-ripper-size 200)
468 ;(bus-ripper-type "component")
469 ;(bus-ripper-symname "busripper-2.sym")
472 ;(bus-ripper-size 200)
473 ;(bus-ripper-type "net")
477 ; The grid-mode keyword controls which mode of grid is used by default in
485 ; The dots-grid-dot-size keyword controls the size of the grid dots in the
486 ; dots grid display. The units are in pixels. The default (min) value of 1
487 ; is the best performing as the grid dot size is rendered as a single pixel.
488 ; Values of 2 and 3 are good values to try if the default grid dot size is
489 ; too small for your tastes. Anything larger than 3 is probably too large.
491 (dots-grid-dot-size 1)
492 ;(dots-grid-dot-size 2)
493 ;(dots-grid-dot-size 3)
497 ; The dots-grid-mode keyword controls the mode of the dotted grid, either
498 ; variable or fixed. In the variable mode, the grid spacing changes
499 ; depending on the zoom factor. In the fixed mode, the grid always
500 ; represents the same number of units as the snap-spacing. You can
501 ; control the density of the grid using the dots-grid-fixed-threshold.
502 (dots-grid-mode "variable")
503 ;(dots-grid-mode "fixed")
505 ; Dots grid fixed threshold
507 ; The dots-grid-fixed-threshold specifies the minimum number of pixels
508 ; grid-spacing for the grid to be displayed. Using this parameter you can
509 ; control thedensity of the displayed grid (smaller numbers will cause the
510 ; grid to be drawn denser). This mode is only used when grid-mode is fixed.
512 (dots-grid-fixed-threshold 10)
514 ; Mesh grid display threshold
516 ; The mesh-grid-display-threshold specifies the minimum line pitch for a the
517 ; grid to be displayed. Using this parameter you can control maximum density
518 ; of the displayed before the minor, then major grid-lines are switched off.
520 (mesh-grid-display-threshold 3)
522 ; force-boundingbox string
524 ; Controls if the entire bounding box of a symbol is used when figuring out
525 ; whichend of the pin is considered the active port. Enable this when
526 ; gschem is guessing incorrectly.
528 (force-boundingbox "disabled")
529 ;(force-boundingbox "enabled")
532 ; add-attribute-offset integer
534 ; This has not been implemented/debugged yet.
535 ; This has not been implemented/debugged yet.
536 ; This has not been implemented/debugged yet.
538 ; Controls a offset which is added to the location of text items that are
539 ; added to an object as an attribute. This offset is added when the following
542 ; 1) Add/Attribute... has been invoked via the hotkey
543 ; 2) It is the "netname" attribute being added
544 ; 3) It is being attached to a horizontal or vertical net segment
545 ; 4) The initial mouse position is at or near the actual net (with one
548 ; If these four conditions are not met, then this offset is not added.
549 ;(add-attribute-offset 50)
552 ; reset-component-library
554 ; When reset-component-library is executed, then all known component library
555 ; paths are erased. This is useful if the user wants to override all the
556 ; system provided paths and provide his/her own set. Normally this is not
559 ; (reset-component-library)
562 ; reset-source-library
564 ; When reset-source-library is executed, then all known source library
565 ; paths are erased. This is useful if the user wants to override all the
566 ; system provided paths and provide his/her own set. Normally this is not
569 ; (reset-source-library)
572 ; End of mode related keywords
581 ;; Comment in this scheme code if you want automatic numbering when
582 ;; placing new component and copying components.
584 ;(load-from-path "auto-uref.scm")
585 ;(add-hook! add-component-hook auto-uref)
586 ;(add-hook! copy-component-hook auto-uref)
588 ;; Define value of page-offset for auto number on insert.
589 ;; Refdeses will be numbered from integer multiples of page-offset,
590 ;; depending on the lowest refdes value found on the page.
591 ;; If lowest value is 323 and page offset is 100, then next refdes
593 ;; Setting to 0 disables the feature.
595 ;(auto-uref-set-page-offset 100)
598 ; Define default pin attributes
601 ; - Value of the attribute.
602 ; - Visibility: #t (visible) or #f (hidden).
603 ; - Show_list: a list containing what to show, using
604 ; elements like "name" or "value", or an empty list.
605 (define default-pin-attributes
606 '(("pintype" "unknown" #f ())
607 ("pinlabel" "unknown" #t ("value"))
608 ("pinnumber" "0" #t ("value"))
609 ("pinseq" "0" #f ())))
611 ; Convert a character into a string
614 (list->string (list char))))
616 ; Attribute autoplacement grid
617 (define autoplace-attributes-grid 50)
619 ; Load the default position of attributes, for attribute autoplacing
621 (load-from-path "default-attrib-positions.scm")
623 ; Adds the default pin attributes to each newly placed pin.
624 (define (add-default-pin-attributes object)
627 (apply add-attribute-to-object object a)) default-pin-attributes))
629 ; Comment in this hook to automatically add the default attributes to
630 ; each newly placed pin
631 (add-hook! add-pin-hook add-default-pin-attributes)
634 ; Comment in this to load the functions to place the attributes automatically.
635 (load-from-path "auto-place-attribs.scm")
637 ; Autoplace pin text attributes hook.
638 ; Comment in these if you want the pin attributes to be automatically placed.
639 ; There are different hooks for situations like adding a new pin and rotating
640 ; or mirroring an existing one.
641 ; The #t at the end means that function is appended to the end of the hook.
642 (add-hook! add-pin-hook (lambda (pin)
643 (autoplace-pin-attributes pin )) #t)
644 ;(add-hook! rotate-pin-hook (lambda (pin)
645 ; (autoplace-pin-attributes pin )) #t)
646 ;(add-hook! mirror-pin-hook (lambda (pin)
647 ; (autoplace-pin-attributes pin )) #t)
649 ; Autoplace component/net/buses text attributes hook.
650 ; Comment in these if you want the component attributes to be
651 ; automatically placed.
652 ; There are different hooks for situations like adding a new pin, rotating
653 ; or mirroring an existing one, adding a new attribute or a new component.
654 ; The #t at the end means that function is appended to the end of the hook.
655 ;(add-hook! add-component-object-hook (lambda (object)
656 ; (autoplace-object-attributes object)) #t)
657 ;(add-hook! rotate-component-object-hook (lambda (object)
658 ; (autoplace-object-attributes object)) #t)
659 ;(add-hook! mirror-component-object-hook (lambda (object)
660 ; (autoplace-object-attributes object)) #t)
661 ;(add-hook! add-attribute-hook (lambda (object)
662 ; (autoplace-object-attributes object)) #t)
663 ;(add-hook! complex-place-list-changed-hook (lambda (object)
664 ; (autoplace-object-attributes object)) #t)
666 ; Autoplace netname= attribute hook. This autoplaces netname
667 ; attribute at the time that it's added.
668 (load-from-path "auto-place-netname.scm")
669 (add-hook! add-objects-hook place-netname-attribute-handler)
671 ; Automatically place a titleblock (or other components) when creating
673 ; Comment in these lines if you want gschem to automatically place a titleblock
674 ; when you create a new _empty_ page.
675 ; Users can customize the default titleblock by adding the following line
676 ; (without the semi-colons at the beginning) to the gschemrc file:
677 ;; (define default-titleblock "title-A4.sym")
678 ;; Change "title-A4.sym" by the name of your preferred titleblock!
680 ; If you don't want a titleblock to be added automatically, then add one of
681 ; the following lines to your gschemrc file (without the semicolon).
682 ; There are several ways, so just choose one:
683 ; (define default-titleblock "")
684 ; (define default-titleblock '())
685 ; (define default-titleblock #f)
687 (define default-titleblock "title-B.sym")
689 ; Load the regular expressions module
690 (if (provided? 'regex)
691 (use-modules (ice-9 regex))
692 (display "Your Guile installation doesn't provide the regex module.\n"))
694 (add-hook! (@ (gschem hook) new-page-hook) (lambda (page)
695 ; Only place the titleblock if there are no objects in the page
696 ; and the page filename ends in ".sym".
697 (if (and (null? (get-objects-in-page page))
698 ; If the guile installation doesn't provide the regex module,
699 ; don't care about the page filename.
700 (if (provided? 'regex)
701 (not (string-match ".*\\.[sS][yY][mM]"
702 (or (get-page-filename page) "")))
704 ; Syntax Symbol name X Y angle selectable mirrored
705 (add-component-at-xy page default-titleblock 40000 40000 0 #f #f))
707 ;; After adding titleblock, reset page to mark as unchanged.
708 ((@ (geda page) set-page-dirty!) (active-page) #f))
711 ; Evaluate an expression entered in the magic-colon text box.
712 ; In 20 years this might dispatch to an interpreter for some other language.
713 (define (invoke-macro s-expr)
714 (gschem-log (format #f "~s\n" (eval-string-protected s-expr))))
721 ; Start of path related keywords
724 ; attribute-name string
726 ; Specifies the default attributes which are presented to the user in the
727 ; "Add Attribute" dialog box.
728 ; The main purpose of this keyword is to allow the user to add any attributes
729 ; which should be in this dialog box.
730 ; Some of these names are specific for symbols while others are for general
731 ; components or nets. The attribute names are case sensitive. (change this?)
733 ; The order of the attribute-name keywords determines the order they
736 (attribute-name "refdes")
737 (attribute-name "value")
738 (attribute-name "footprint")
739 (attribute-name "device")
740 (attribute-name "source")
741 (attribute-name "param")
742 (attribute-name "model-name")
743 (attribute-name "model")
744 (attribute-name "netname")
745 (attribute-name "net")
746 (attribute-name "portname")
747 (attribute-name "pinnumber")
748 (attribute-name "pinseq")
749 (attribute-name "pintype")
750 (attribute-name "pinlabel")
751 (attribute-name "numslots")
752 (attribute-name "slot")
753 (attribute-name "slotdef")
754 (attribute-name "graphical")
755 (attribute-name "description")
756 (attribute-name "documentation")
757 (attribute-name "comment")
758 (attribute-name "symversion")
759 (attribute-name "author")
760 (attribute-name "dist-license")
761 (attribute-name "use-license")
762 (attribute-name "file")
765 ; End of path related keywords
769 ; Start of stroke related keywords
773 ; This section defines associations between a stroke sequence and a
774 ; guile function which is executed when the stroke is drawn in the
777 ; Strokes are defined as follows:
785 ; The sequence of number such as "852" specify how the stroke is drawn.
786 ; Sequence "852" happens to be a vertical line drawn from the bottom going
789 ; Please see the libstroke documentation for further information on the
790 ; stroke description.
792 ; For the most part I went a little overboard on the stroke defs, you
793 ; probably can get away with many less stroke defs, but I'm a very
794 ; sloppy stroke drawing person. :-) Guess my teachers were always
795 ; right-- my handwritting was/is awful.
797 ; Be careful here, strokes is a rather large list, and make sure you maintain
802 `(;; Letter L for line
803 ("14789" . ,&add-line)
805 ;; Letter Z for zoom window
806 ("125789" . ,&view-zoom-box)
807 ("1254789" . ,&view-zoom-box)
808 ("1235789" . ,&view-zoom-box)
809 ("2354789" . ,&view-zoom-box)
810 ("2324789" . ,&view-zoom-box)
811 ("12354789" . ,&view-zoom-box)
812 ("12324789" . ,&view-zoom-box)
813 ("12365789" . ,&view-zoom-box)
814 ("1232789" . ,&view-zoom-box)
816 ;; line up for zoom out
817 ("852" . ,&view-zoom-out)
818 ;; line down for zoom in
819 ("258" . ,&view-zoom-in)
822 ("3214789" . ,&edit-copy)
823 ("214789" . ,&edit-copy)
824 ("21489" . ,&edit-copy)
825 ("32478" . ,&edit-copy)
828 ("563214789" . ,&edit-edit)
829 ("53214789" . ,&edit-edit)
830 ("5321478" . ,&edit-edit)
831 ("5214789" . ,&edit-edit)
832 ("521478" . ,&edit-edit)
833 ("453214789" . ,&edit-edit)
834 ("45321478" . ,&edit-edit)
835 ("456321478" . ,&edit-edit)
836 ("456214789" . ,&edit-edit)
837 ("45621478" . ,&edit-edit)
840 ("415963" . ,&add-net)
841 ("7414863" . ,&add-net)
842 ("74148963" . ,&add-net)
843 ("74158963" . ,&add-net)
844 ("7415963" . ,&add-net)
847 ("741236963" . ,&edit-move)
848 ("7412572369" . ,&edit-move)
849 ("7412575369" . ,&edit-move)
850 ("741258369" . ,&edit-move)
851 ("74125852369" . ,&edit-move)
852 ("7412585369" . ,&edit-move)
853 ("74125863" . ,&edit-move)
854 ("74126963" . ,&edit-move)
855 ("741475369" . ,&edit-move)
856 ("7414785369" . ,&edit-move)
857 ("74148369" . ,&edit-move)
858 ("7414852369" . ,&edit-move)
859 ("741485369" . ,&edit-move)
860 ("74148669" . ,&edit-move)
861 ("741552369" . ,&edit-move)
862 ("741575369" . ,&edit-move)
863 ("7415852369" . ,&edit-move)
864 ("741585369" . ,&edit-move)
865 ("74185369" . ,&edit-move)
866 ("74255369" . ,&edit-move)
867 ("7425852369" . ,&edit-move)
868 ("742585369" . ,&edit-move)
869 ("7426963" . ,&edit-move)
870 ("74585369" . ,&edit-move)
872 ;; Letter D for delete
873 ("14786321" . ,&edit-delete)
874 ("14789621" . ,&edit-delete)
875 ("147896321" . ,&edit-delete)
876 ("15896321" . ,&edit-delete)
877 ("257896321" . ,&edit-delete)
878 ("25896321" . ,&edit-delete)
879 ("4789621" . ,&edit-delete)
881 ;; Letter S for select
882 ("2145987" . ,&edit-select)
883 ("215987" . ,&edit-select)
884 ("2156987" . ,&edit-select)
885 ("21256987" . ,&edit-select)
886 ("3215987" . ,&edit-select)
887 ("32156987" . ,&edit-select)
888 ("32148987" . ,&edit-select)
889 ("32145987" . ,&edit-select)
891 ;; Left for previous page
892 ("654" . ,&page-prev)
894 ;; Right for next page
895 ("456" . ,&page-next)
897 ;; Right and down to edit subschematic
898 ("12369" . ,&hierarchy-down-schematic)
900 ;; Left and down to edit symbol
901 ("32147" . ,&hierarchy-down-symbol)
903 ;; Up and sideways (any order) to go up
904 ("96321" . ,&hierarchy-up)
905 ("98741" . ,&hierarchy-up)
906 ("74123" . ,&hierarchy-up)
907 ("78963" . ,&hierarchy-up)))
910 ; End of stroke related keywords
914 ; Start of keymapping related keywords
919 ;; Actions defined here are available for key bindings and/or menu
922 ;; (define-action (&hello-world
923 ;; #:name "Hello World"
924 ;; #:label "Hello World"
925 ;; #:menu-label "_Hello World")
926 ;; (display "Hello world!")
929 ;; #:name is the general name of the action, e.g. shown in the hotkey
930 ;; list. #:label is the label associated with the action, e.g. shown
931 ;; in the popup menu. #:menu-label is the label of the item as it
932 ;; will appear in the main menu. Only #:menu-label should contain an
933 ;; underscored letter.
938 ;; Everything is case-sensitive. Any number of keys may be bound in
939 ;; sequence, and each keystroke consists of a non-modifier key with
940 ;; some number of modifiers applied. Examples:
942 ;; * (global-set-key "F N" &file-new-window)
944 ;; The "New Window" command will be run when an <F> is typed,
945 ;; followed by an <A>.
947 ;; * (global-set-key "<Control><Shift>A" &edit-deselect)
949 ;; The "Deselect All" command will be run when the <Ctrl> and
950 ;; <Shift> keys are held down, and the <A> key is pressed.
952 ;; * (global-set-key "E <Shift>B" &edit-unembed)
954 ;; The "Unembed" command will be run when an <E> is typed,
955 ;; followed by an <B> typed with the <Shift> key held down.
957 ;; Key names can be found in /usr/include/gtk-2.0/gdk/gdkkeysyms.h on
958 ;; most Linux systems. For other systems, please see your platform
961 ;; Later keybindings override earlier ones.
963 (global-set-key "A C" &add-last-component)
964 (global-set-key "A A" &add-attribute)
965 (global-set-key "A N" &add-net)
966 (global-set-key "A U" &add-bus)
967 (global-set-key "A T" &add-text)
968 (global-set-key "A L" &add-line)
969 (global-set-key "A H" &add-path)
970 (global-set-key "A B" &add-box)
971 (global-set-key "A V" &add-circle)
972 (global-set-key "A I" &add-circle)
973 (global-set-key "A R" &add-arc)
974 (global-set-key "A P" &add-pin)
975 (global-set-key "A G" &add-picture)
977 (global-set-key "B" &add-box)
978 (global-set-key "<Shift>B" &add-bus)
979 (global-set-key "C" &edit-copy)
980 (global-set-key "D" &edit-delete)
982 (global-set-key "E S" &edit-select)
983 (global-set-key "E C" &edit-copy)
984 (global-set-key "E E" &edit-edit)
985 (global-set-key "E Y" &edit-mcopy)
986 (global-set-key "E X" &edit-text)
987 (global-set-key "E M" &edit-move)
988 (global-set-key "E D" &edit-delete)
989 (global-set-key "E R" &edit-rotate-90)
990 (global-set-key "E I" &edit-mirror)
991 (global-set-key "E <Shift>S" &edit-slot)
992 (global-set-key "E O" &edit-properties) ; merged with "E P"
993 (global-set-key "E L" &edit-lock)
994 (global-set-key "E <Shift>L" &edit-unlock)
995 (global-set-key "E W" &edit-properties) ; merged with "E P"
996 (global-set-key "E F" &edit-properties) ; merged with "E P"
997 (global-set-key "E P" &edit-properties)
998 (global-set-key "E T" &edit-translate)
999 (global-set-key "E <Shift>colon" &edit-invoke-macro)
1000 (global-set-key "E B" &edit-embed)
1001 (global-set-key "E <Shift>B" &edit-unembed)
1002 (global-set-key "E U" &edit-update)
1003 (global-set-key "E N" &edit-show-hidden)
1005 (global-set-key "F W" &file-new-window)
1006 (global-set-key "F N" &file-new)
1007 (global-set-key "F O" &file-open)
1008 (global-set-key "F S" &file-save)
1009 (global-set-key "F E" &page-close)
1010 (global-set-key "F C" &page-close)
1011 (global-set-key "F A" &file-save-as)
1012 (global-set-key "F L" &file-save-all)
1013 (global-set-key "F P" &file-print)
1014 (global-set-key "F R" &page-revert)
1015 (global-set-key "F I" &file-image)
1016 (global-set-key "F T" &file-script)
1017 (global-set-key "F <Shift>R" &file-repl)
1018 ;(global-set-key "F C" &file-close-window)
1019 (global-set-key "F Q" &file-quit)
1021 (global-set-key "G colon" &edit-invoke-macro)
1022 (global-set-key "G S" &file-script)
1023 (global-set-key "G R" &file-repl)
1025 (global-set-key "F1" &help-manual)
1026 (global-set-key "H A" &help-about)
1027 (global-set-key "H M" &help-manual)
1028 (global-set-key "H F" &help-faq)
1029 (global-set-key "H G" &help-guide)
1030 (global-set-key "H W" &help-wiki)
1031 (global-set-key "H H" &help-hotkeys)
1032 (global-set-key "H C" &hierarchy-documentation)
1034 ;(global-set-key "<Shift>H D" &hierarchy-down-schematic)
1035 ;(global-set-key "<Shift>H S" &hierarchy-down-symbol)
1036 ;(global-set-key "<Shift>H U" &hierarchy-up)
1037 ;(global-set-key "<Shift>H O" &hierarchy-documentation)
1039 (global-set-key "I" &add-component)
1040 (global-set-key "L" &add-line)
1041 (global-set-key "M" &edit-move)
1042 (global-set-key "N" &add-net)
1044 (global-set-key "O O" &options-options)
1045 (global-set-key "O A" &options-action-feedback)
1046 (global-set-key "O G" &options-grid)
1047 (global-set-key "O S" &options-snap)
1048 (global-set-key "O R" &options-rubberband)
1049 (global-set-key "O M" &options-magneticnet)
1050 (global-set-key "O L" &options-show-log-window)
1051 (global-set-key "O C" &options-show-coordinates)
1053 (global-set-key "P M" &page-manager)
1054 ;(global-set-key "P N" &page-next)
1055 ;(global-set-key "P P" &page-prev)
1056 ;(global-set-key "P R" &page-revert)
1057 ;(global-set-key "P C" &page-close)
1058 ;(global-set-key "P <Shift>P" &page-print)
1059 (global-set-key "F5" &page-update-messages)
1061 (global-set-key "Q" &hierarchy-up)
1062 (global-set-key "<Alt>Q" &file-quit)
1063 (global-set-key "R" &view-redraw)
1064 (global-set-key "<Shift>R" &edit-redo)
1065 ;(global-set-key "S" &edit-select)
1066 (global-set-key "S" &hierarchy-down-schematic)
1067 (global-set-key "<Shift>S" &hierarchy-down-symbol)
1069 (global-set-key "T A" &attributes-attach)
1070 (global-set-key "T D" &attributes-detach)
1071 (global-set-key "T N" &attributes-show-name)
1072 (global-set-key "T V" &attributes-show-value)
1073 (global-set-key "T B" &attributes-show-both)
1074 (global-set-key "T T" &attributes-visibility-toggle)
1075 (global-set-key "T O" &attributes-overbar-toggle)
1076 (global-set-key "T <Shift>F" &edit-find-text)
1077 (global-set-key "T <Shift>P" &edit-find-patch)
1078 (global-set-key "T H" &edit-hide-text)
1079 (global-set-key "T <Shift>H" &edit-show-text)
1080 (global-set-key "T L" &edit-select-locked)
1081 (global-set-key "T U" &edit-autonumber)
1083 (global-set-key "U" &edit-undo)
1084 (global-set-key "<Shift>U" &edit-redo)
1086 (global-set-key "V M" &view-menubar)
1087 (global-set-key "V T" &view-toolbar)
1088 (global-set-key "V S" &view-scrollbars)
1089 (global-set-key "V G" &view-show-origin)
1090 (global-set-key "V R" &view-redraw)
1091 (global-set-key "V B" &view-zoom-box)
1092 (global-set-key "V F" &view-zoom-full)
1093 (global-set-key "V E" &view-zoom-extents)
1094 (global-set-key "V P" &view-pan)
1095 (global-set-key "V O" &view-zoom-out)
1096 (global-set-key "V I" &view-zoom-in)
1097 (global-set-key "V D" &view-dark-colors)
1098 (global-set-key "V L" &view-light-colors)
1099 (global-set-key "V W" &view-light-bw-colors)
1101 (global-set-key "W" &view-zoom-box)
1102 (global-set-key "X" &view-pan)
1104 ;(global-set-key "Y C" &buffer-copy1)
1105 ;(global-set-key "Y U" &buffer-cut1)
1106 ;(global-set-key "Y P" &buffer-paste1)
1108 (global-set-key "Z" &view-zoom-in)
1109 (global-set-key "<Shift>Z" &view-zoom-out)
1111 (global-set-key "<Control>N" &file-new)
1112 (global-set-key "<Control>O" &file-open)
1113 (global-set-key "<Control>S" &file-save)
1114 (global-set-key "<Control><Shift>S" &file-save-as)
1115 (global-set-key "<Control>P" &file-print)
1116 (global-set-key "<Control>W" &file-close-window)
1117 (global-set-key "<Control>Q" &file-quit)
1119 (global-set-key "<Control>Z" &edit-undo)
1120 (global-set-key "<Control>Y" &edit-redo)
1121 (global-set-key "<Control><Shift>Z" &edit-redo)
1122 (global-set-key "<Control>X" &clipboard-cut)
1123 (global-set-key "<Control>C" &clipboard-copy)
1124 (global-set-key "<Control>V" &clipboard-paste)
1125 (global-set-key "<Control>A" &edit-select-all)
1126 (global-set-key "<Control><Shift>A" &edit-deselect)
1127 (global-set-key "<Control>F" &edit-find-text)
1129 (global-set-key "Escape" &cancel)
1130 (global-set-key "bracketright" &options-scale-up-snap-size)
1131 (global-set-key "bracketleft" &options-scale-down-snap-size)
1132 (global-set-key "Left" &view-pan-left)
1133 (global-set-key "Right" &view-pan-right)
1134 (global-set-key "Up" &view-pan-up)
1135 (global-set-key "Down" &view-pan-down)
1136 (global-set-key "period" &repeat-last-action)
1137 (global-set-key "Delete" &edit-delete)
1138 (global-set-key "Page_Down" &page-next)
1139 (global-set-key "Page_Up" &page-prev)
1140 (global-set-key "<Control>Page_Down" &page-next)
1141 (global-set-key "<Control>Page_Up" &page-prev)
1142 (global-set-key "greater" &page-next)
1143 (global-set-key "less" &page-prev)
1146 ;;;; Definitions for the main menu bar, context menu, and toolbar
1148 ;; The main menu definition is split into individual variables in order
1149 ;; to allow for easier modification of the menus. Each menu definition
1150 ;; is a list of sections; each section is a list of action objects.
1151 ;; Separators are automatically inserted between adjacent sections.
1153 ;; The labels and icons which are displayed in the menu are determined
1154 ;; by the individual action objects. The hotkeys are defined by the
1155 ;; global keymap. Actions can have several hotkeys, but only the
1156 ;; hotkey defined last will be displayed.
1158 ;; When adding actions to the menu e.g. from your "gschemrc" file, you
1159 ;; don't have to copy and paste the menu definition but can alter the
1160 ;; existing definition. This has the advantage that you won't get out
1161 ;; of sync with changes in newer versions of gschem. Examples:
1163 ;; * Adding a section to a menu
1166 ;; (append! tools-menu
1167 ;; `((,&do-something
1168 ;; ,&do-something-else))))
1170 ;; * Adding a menu to the menubar
1173 ;; `((,&do-something
1174 ;; ,&do-something-else)))
1176 ;; (let ((t (list-tail menubar (- (length menubar) 2))))
1177 ;; (set-cdr! t (cons (cons "My Menu" my-menu) (cdr t))))
1179 ;; * Replacing a whole menu
1181 ;; (define my-help-menu
1182 ;; `((,&do-something
1183 ;; ,&do-something-else)
1186 ;; (assoc-set! menubar (_ "_Help") my-help-menu)
1188 ;; * Replacing the context menu
1190 ;; (set! context-menu
1191 ;; `((,&edit-select)
1193 ;; ,&do-something-else)))
1195 ;; * Adding a section to the toolbar
1197 ;; (let ((buttons `((,&do-something
1198 ;; ,&do-something-else)))
1199 ;; (t (list-tail toolbar (- (length toolbar) 2))))
1200 ;; (set-cdr! t (append! buttons (cdr t))))
1226 (,&edit-find-text)))
1230 ,&add-last-component
1254 ,&attributes-show-value
1255 ,&attributes-show-name
1256 ,&attributes-show-both
1257 ,&attributes-visibility-toggle
1258 ,&attributes-overbar-toggle)
1265 ,&hierarchy-documentation)))
1268 `((,&edit-show-hidden
1280 (,&docking-area-left
1281 ,&docking-area-bottom
1282 ,&docking-area-right)))
1285 `((,&page-update-messages)
1286 (,&hierarchy-down-schematic
1287 ,&hierarchy-down-symbol
1294 `((,&edit-autonumber
1299 ,&edit-select-locked)
1300 (,&options-show-log-window
1301 ,&options-show-coordinates)
1302 (,&edit-invoke-macro
1306 (define options-menu
1307 `((,&options-options)
1308 (,&options-rubberband
1309 ,&options-magneticnet
1310 ,&options-action-feedback)
1313 ,&options-snap-resnap
1314 ,&options-scale-up-snap-size
1315 ,&options-scale-down-snap-size)
1318 ,&view-light-bw-colors
1319 ,&view-shaded-colors
1320 ,&view-shaded-bw-colors)))
1331 `((,(_ "_File") . ,file-menu)
1332 (,(_ "_Edit") . ,edit-menu)
1333 (,(_ "_Add") . ,add-menu)
1334 (,(_ "O_bject") . ,object-menu)
1335 (,(_ "_View") . ,view-menu)
1336 (,(_ "_Pages") . ,pages-menu)
1337 (,(_ "_Tools") . ,tools-menu)
1338 (,(_ "_Options") . ,options-menu)
1339 (,(_ "_Help") . ,help-menu)))
1341 (define context-menu
1344 ,&add-last-component
1351 ,&view-zoom-extents)
1357 (,&hierarchy-down-schematic
1358 ,&hierarchy-down-symbol
1374 (,&hierarchy-down-schematic
1375 ,&hierarchy-down-symbol
1377 (,&options-grid-size)
1382 ; End of keymapping related keywords
1390 ;; Comment in this scheme code if you want to link with pcb
1392 ;; Please note that the code in pcb.scm is still highly experimental
1393 ;; and there are known (and easy) ways to crash pcb and/or gschem with this code.
1394 ;; The short answer is neither program likes a pipe to break.
1396 ; (load-from-path "pcb.scm")