home *** CD-ROM | disk | FTP | other *** search
-
- The WimpKey module (version 1.10)
- =================================
-
- Free Distribution Software (FreeWare) by Jason Williams
- Extended by Sam Kington
- This software is NOT Public Domain
-
- 1. This software remains the copyright of the authors, Jason Williams and
- Sam Kington, but it may be freely distributed and used, provided that when being
- distributed on its own:
- a) it is kept as a whole- The module and this documentation file must be
- distributed, unmodified, together.
- b) no charge is made for any copying or distribution other than third
- party transmission costs (eg disc cost, postage, phone charges).
-
- 2. The authors do not accept any responsibility for any use or misuse of
- the software or any consequences thereof, and make no guarantees of
- continued support for the module.
-
- 3. This module may be included as part of any product, including commercial
- software, free of charge, so long as its use is acknowledged in the
- accompanying documentation. Be aware of item 2.
-
- --===--
-
- The WimpKey module provides a very simple service to help with using
- dynamic key bindings in WIMP applications.
-
- Dynamic key bindings are "hot keys" for common operations, that are set in
- some sort of configuration file which the user may edit in order to change the
- keys used in the program to more suitable values. It is important that programs
- allow such configuration, both to enable people to configure the program to
- their own tastes, and also to make internationalisation much simpler.
-
- As well as making life easier for the programmer (it takes a long time to
- code this sort of thing if you're starting from scratch), it allows this
- table to be shared by all applications on the desktop (reducing their size),
- and it helps to enforce a standard naming convention for all of these keys.
- Hopefully it will also encourage other lazy authors to actually put key
- bindings in to their programs now!
-
- An additional advantage is that WimpKey provides extra key codes for certain
- key combinations: Return (rather than Ctrl-M), Ctrl-Shift-A to Z, as well as
- the more esoteric Keypad-* and Alt-Ctrl-Shift-Tab, among others. As anyone
- who uses Impression regularly will know, there are a limited number of
- hotkeys available: this should give you a bit more breathing space.
-
- The module provides 3 SWI commands, as well as a * command:
-
-
- The command: *ListWimpKeys
- ==========================
-
- This command simply produces a list of the available wimp key mappings,
- showing the hexadecimal WIMP key code (as returned by Wimp Poll on key events)
- and the WimpKey string used to represent that key.
-
-
- SWI "WimpKey_CodeToString" &47BC0
- =================================
-
- Entry: R0 = WIMP key code
- Exit: R0 = pointer to the equivalent string (0-terminated), or
- NULL (0) if the keycode is unknown
- All other registers preserved
-
- Description:
- This SWI takes a normal WIMP key code, and produces the relevant
- keycode string. This is intended for use where your program
- knows the key code of a key, and wishes to add a textual reminder
- alongside a menu item (for example) for the user.
-
- NOTE that the string returned is zero terminated, and that it is
- in the module's private workspace. It will be overwritten by the
- next call to this SWI, so if you want to use the string, you must
- copy it into your own workspace first.
-
- Keycode strings are a maximum of 9 characters long including the
- terminating NULL character.
-
-
- SWI "WimpKey_StringToCode" &47BC1
- =================================
-
- Entry: R0 = pointer to keycode string
- Exit: R0 = The related wimp key code, or -1 if the string was not found
- All other registers preserved
-
- Description:
- This SWI takes a key code string (which may be up to 9 characters
- long, including the terminator. The terminator can be any ctrl-
- character (i.e. any char in the range ASCII 0 to ASCII 31)), and
- converts it into a WIMP key code number.
-
- This is intended for use when reading a configuration file or
- otherwise editing key codes (e.g. like the Impression style
- editor's hotkey entry thingo) - the user can enter a value as
- a meaningful string, and your program can convert this into a
- WIMP key code for itself using the SWI.
-
- Note that the string passed in must EXACTLY match the keycode
- string (case and all).
-
- Note also the special values "Return" and "Enter", which are
- explained at the end of this text.
-
- SWI "WimpKey_CodeToExtCode" &47BC2
- =================================
-
- Entry: R0 = key code provided by Wimp_Poll
- Exit: R0 = extended key code if there is one available, otherwise preserved.
- All other registers preserved
-
- Description:
- This SWI takes the key code returned by Wimp_Poll, and checks
- whether it matches any of the extended codes provided by
- WimpKey; if so, it converts it, otherwise it leaves it as it is.
- This SWI should be used in preference to manually converting the
- raw value into a WimpKey-friendly code, like you had to do with
- previous versions of WimpKey, as a) it's faster, and b) it's
- done for you.
-
- Current keycode definitions
- ===========================
-
- Here is the output from the *ListWimpKeys command on the current version
- of the module. Codes prefixed with a '*' are new to this version. Codes over
- &1000 can only be produced with the SWI WimpKey_CodeToExtCode (see notes
- below). As is standard on Acorn machines, ⇧ stands for Shift and ^ for Ctrl;
- the Alt key is nowhere near as commonly used so there isn't really a standard
- symbol for it, but ~ seems as standard as anything.
-
- *ListWimpKeys
-
- Available WIMP key codes: (hit SHIFT to scroll)
- Keycode String
- &0000 ^@
- &0001 ^A
- &0002 ^B
- &0003 ^C
- &0004 ^D
- &0005 ^E
- &0006 ^F
- &0007 ^G
- &0008 ^H
- &0009 ^I
- &000A ^J
- &000B ^K
- &000C ^L
- &000D ^M
- &000E ^N
- &000F ^O
- &0010 ^P
- &0011 ^Q
- &0012 ^R
- &0013 ^S
- &0014 ^T
- &0015 ^U
- &0016 ^V
- &0017 ^W
- &0018 ^X
- &0019 ^Y
- &001A ^Z
- &001B Escape
- &001B ESC
- * &001C ^\
- * &001D ^]
- &001E Home
- * &001F ^-
- &0020 Space
- &0020 SPC
- &0021 !
- &0022 "
- &0023 #
- &0024 $
- &0025 %
- &0026 &
- &0027 '
- &0028 (
- &0029 )
- &002A *
- &002B +
- &002C ,
- &002D -
- &002E .
- &002F /
- &0030 0
- &0031 1
- &0032 2
- &0033 3
- &0034 4
- &0035 5
- &0036 6
- &0037 7
- &0038 8
- &0039 9
- &003A :
- &003B ;
- &003C <
- &003D =
- &003E >
- &003F ?
- &0040 @
- &0041 A
- &0042 B
- &0043 C
- &0044 D
- &0045 E
- &0046 F
- &0047 G
- &0048 H
- &0049 I
- &004A J
- &004B K
- &004C L
- &004D M
- &004E N
- &004F O
- &0050 P
- &0051 Q
- &0052 R
- &0053 S
- &0054 T
- &0055 U
- &0056 V
- &0057 W
- &0058 X
- &0059 Y
- &005A Z
- &005B [
- &005C \
- &005D ]
- &005E ^
- &005F _
- &0060 `
- &0061 a
- &0062 b
- &0063 c
- &0064 d
- &0065 e
- &0066 f
- &0067 g
- &0068 h
- &0069 i
- &006A j
- &006B k
- &006C l
- &006D m
- &006E n
- &006F o
- &0070 p
- &0071 q
- &0072 r
- &0073 s
- &0074 t
- &0075 u
- &0076 v
- &0077 w
- &0078 x
- &0079 y
- &007A z
- &007B {
- &007C |
- &007D }
- &007E ~
- &007F Delete
- &007F DEL
- &0180 Print
- &0181 F1
- &0182 F2
- &0183 F3
- &0184 F4
- &0185 F5
- &0186 F6
- &0187 F7
- &0188 F8
- &0189 F9
- &018A Tab
- &018B Copy
- &018C Left
- &018D Right
- &018E Down
- &018F Up
- &018C ⇦
- &018D ⇨
- &018E ⇩
- &018F ⇧
- &0190 ⇧Print
- &0191 ⇧F1
- &0192 ⇧F2
- &0193 ⇧F3
- &0194 ⇧F4
- &0195 ⇧F5
- &0196 ⇧F6
- &0197 ⇧F7
- &0198 ⇧F8
- &0199 ⇧F9
- &019A ⇧Tab
- &019B ⇧Copy
- &019C ⇧Left
- &019C ⇧⇦
- &019D ⇧Right
- &019D ⇧⇨
- &019E PageDn
- &019E ⇧Down
- &019F PageUp
- &019F ⇧Up
- &01A0 ^Print
- &01A1 ^F1
- &01A2 ^F2
- &01A3 ^F3
- &01A4 ^F4
- &01A5 ^F5
- &01A6 ^F6
- &01A7 ^F7
- &01A8 ^F8
- &01A9 ^F9
- &01AA ^Tab
- &01AB ^Copy
- &01AC ^Left
- &01AD ^Right
- &01AE ^Down
- &01AF ^Up
- &01AC ^⇦
- &01AD ^⇨
- &01AE ^⇩
- &01AF ^⇧
- &01B0 ^⇧Print
- &01B1 ^⇧F1
- &01B2 ^⇧F2
- &01B3 ^⇧F3
- &01B4 ^⇧F4
- &01B5 ^⇧F5
- &01B6 ^⇧F6
- &01B7 ^⇧F7
- &01B8 ^⇧F8
- &01B9 ^⇧F9
- &01BA ^⇧Tab
- &01BB ^⇧Copy
- &01BC ^⇧Left
- &01BD ^⇧Right
- &01BE ^⇧Down
- &01BF ^⇧Up
- &01BC ^⇧⇦
- &01BD ^⇧⇨
- &01BE ^⇧⇩
- &01BF ^⇧⇧
- &01BE ^PageDn
- &01BE ^⇧Down
- &01BF ^PageUp
- &01BF ^⇧Up
- &01CA F10
- &01CB F11
- &01CC F12
- &01CD Insert
- &01DA ⇧F10
- &01DB ⇧F11
- &01DC ⇧F12
- &01DD ⇧Insert
- &01EA ^F10
- &01EB ^F11
- &01EC ^F12
- &01ED ^Insert
- &01FA ^⇧F10
- &01FB ^⇧F11
- &01FC ^⇧F12
- &01FD ^⇧Insert
- &1000 Return
- &1000 Enter
- * &1003 Pad#
- * &1008 Back
- * &1010 ⇧Return
- * &1018 ⇧Back
- * &101B ⇧Escape
- * &101E ⇧Home
- * &101F ⇧Delete
- * &1023 ^Pad#
- * &102B ^Escape
- * &102E ^Home
- * &102F ^Delete
- * &1033 ^⇧Pad#
- * &103B ^⇧Esc
- * &103E ^⇧Home
- * &103F ^⇧Del
- * &104A Pad*
- * &104B Pad+
- * &1050 ⇧Pad0
- * &1051 ⇧Pad1
- * &1052 ⇧Pad2
- * &1053 ⇧Pad3
- * &1054 ⇧Pad4
- * &1055 ⇧Pad5
- * &1056 ⇧Pad6
- * &1057 ⇧Pad7
- * &1058 ⇧Pad8
- * &1059 ⇧Pad9
- * &105D ⇧Pad-
- * &105E ⇧Pad.
- * &105F ⇧Pad/
- * &1060 ^Pad0
- * &1061 ^Pad1
- * &1062 ^Pad2
- * &1063 ^Pad3
- * &1064 ^Pad4
- * &1065 ^Pad5
- * &1066 ^Pad6
- * &1067 ^Pad7
- * &1068 ^Pad8
- * &1069 ^Pad9
- * &106A ^Pad*
- * &106B ^Pad+
- * &106D ^Pad-
- * &106E ^Pad.
- * &106F ^Pad/
- * &1070 ^⇧Pad0
- * &1071 ^⇧Pad1
- * &1072 ^⇧Pad2
- * &1073 ^⇧Pad3
- * &1074 ^⇧Pad4
- * &1075 ^⇧Pad5
- * &1076 ^⇧Pad6
- * &1077 ^⇧Pad7
- * &1078 ^⇧Pad8
- * &1079 ^⇧Pad9
- * &107A ^⇧Pad*
- * &107B ^⇧Pad+
- * &107D ^⇧Pad-
- * &107E ^⇧Pad.
- * &107F ^⇧Pad/
- * &1080 ~Tab
- * &1090 ~⇧Tab
- * &10A0 ~^Tab
- * &10B0 ~^⇧Tab
- &2000 ^⇧@
- &2001 ^⇧A
- &2002 ^⇧B
- &2003 ^⇧C
- &2004 ^⇧D
- &2005 ^⇧E
- &2006 ^⇧F
- &2007 ^⇧G
- &2008 ^⇧H
- &2009 ^⇧I
- &200A ^⇧J
- &200B ^⇧K
- &200C ^⇧L
- &200D ^⇧M
- &200E ^⇧N
- &200F ^⇧O
- &2010 ^⇧P
- &2011 ^⇧Q
- &2012 ^⇧R
- &2013 ^⇧S
- &2014 ^⇧T
- &2015 ^⇧U
- &2016 ^⇧V
- &2017 ^⇧W
- &2018 ^⇧X
- &2019 ^⇧Y
- &201A ^⇧Z
- * &201C ^⇧\
- * &201D ^⇧]
- * &201F ^⇧-
-
-
- (If you spot any errors in this list, please let me know ASAP!)
-
-
- SPECIAL NOTES
- =============
-
- Please note that there are some keys which do not normally have unique key
- numbers: for example, ^M, Return, and Enter all share code &0D, the up and
- down cursor arrows share many codes in common with the page up and down keys,
- numeric keypad keys are indistinguishable from the other numeric keys and
- some keys produce the same value irrespective of whether Shift or Ctrl are
- held down.
-
- The only way of telling these keys apart is to check if certain shifting keys
- (Shift, Ctrl, Alt) are held down when you recieve a key event - a not
- entirely cast-iron practice, as key presses can be buffered for some time
- before you receive an event. Usually it works fine: keypresses usually get to
- their receiver almost instantaneously, and you've got to be pretty quick to
- let go of the keys early enough to foul things up. (Especially as most
- people, if anything, let go of the shifting key *after* they let go of the
- other key, not before).
-
- In previous versions of the module you had to convert the raw values
- manually; with this version there is a SWI, WimpKey_CodeToExtCode, that will
- do it for you. That's just as well, as all the key combinations that can be
- told apart under standard RISC OS are now catered for; mainly numeric keypad
- keypresses, but also things like Ctrl-Home, Shift-Escape and other such
- stuff.
-
- From version 1.01 of the module onwards there are some duplicate bindings.
- All of the old mappings are still available for string lookup, but looking up
- a number in the list will return the new string variants:
-
- SPC now also has a mapping Space
- DEL Delete
- ESC Escape
-
- and there are new cursor-key mappings (Left, Right, Up, Down, etc)
-
-
- Contacting the authors
- ======================
-
- Bug reports, suggestions, or other miscellaneous comments are always welcome,
- but as there are now two authors of this module you may be confused who to
- contact. Don't let that put you off: any general comments will usually be
- forwarded between the two of us. But in general, anything relating to the
- general core of the module should be sent to Jason Williams, the original
- author of the module, and anything about the new keycodes should be sent to
- Sam Kington.
-
- Here's how to get to us.
-
- Jason Williams
- ==============
-
- Email: jason@cconcepts.co.uk
- or snail mail at Computer Concepts.
-
- *Disclaimer*:Although I work for Computer Concepts, and this is the only
- permanent contact address I can currently supply, development of/support for
- WimpKey has absolutely nothing whatsoever to do with Computer Concepts
-
- Any enquiries to Computer Concepts about this module will most likely be
- met with a blank, uncomprehending stare, so make sure you ask *me*.
-
- If you wish to use this module in a commercial application, it would be a good
- idea to contact Jason to see if there is a newer version of the module
- available.
-
- Sam Kington
- ===========
-
- Email: 926286ki@udcf.gla.ac.uk (until June 1996)
-
- Snail mail: Flat 2/1 (until June 1995)
- 44 Hotspur St
- Glasgow G20 8NL
-
- or Merlhiot (permanent back-up)
- 24420 Savignac les Eglises
- FRANCE
-
-