Documention for: button-key.r Created by: btiffin on: 25-Apr-2007 Last updated by: btiffin on: 28-Apr-2007 Format: text/editable Downloaded on: 18-Apr-2024 [h1 Usage document for %button-key.r [contents [numbering-on [h2 Introduction to %button-key.r [p This library script shows how easy it is to add key bindings to VID face styles (see below for term explanations), in particular, <strong>buttons</strong>. [h2 Using %button-key.r [p Using this script is simple. Just <strong>DO</strong> it. [asis >>do %button-key.r asis] [p or to execute this right out of the rebol.org library [asis/style/font-size:75% >>do http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=button-key.r asis] [p When running, tapping the <strong>q</strong> on the keyboard will activate the button which has an action block of [asis [quit] asis] and the script will quit. [h2 What you can learn [h3 Face Style [p Face style is a REBOL term that you may have heard referred to as 'widget' or 'graphical element'. REBOL programmers may use just the word face, or just style when talking about 'window gadgets'. Modifiers are termed 'facets'. [p Reading the [link http://rebol.com/docs/view-guide.html "REBOL/View Developer's Guide" will explain the preferred terms used for REBOL graphical programming. [h3 Datatype char! [p This sample script, uses #"q", to specify the character <strong>q</strong>. REBOL programmers use this character quite a bit, and it consistently means <strong>quit</strong>. If you wanted this key binding to be Ctrl-Q it would be specified as #"^Q" char! spec. [h3 View facets [p Looking through this script, you'll see how easy it is to bind a key to a face. Just name an char! datatype after the face style and if possible it will be used as the keyboard shortcut binding for that face. As with most VID facets, the char! is optional. REBOL does not use any default bindings for any particular face. Some keys like Tab, Enter, Backspace are active in most input faces, and for travelling around the screen faces. [h2 Credits [li %button-key.r original author: Unknown [li Usage document by Brian Tiffin, Library Team Apprentice, [date