Short: Assign Functions to Keys Author: sisk637 cyberonic com (Robert A. Sisk) Uploader: sisk637 cyberonic com Type: util/cdity Version: 1.5 Replaces: util/cdity/FKeyPlus.lha Requires: util/libs/mui38usr.lha util/rexx/rxmui.lha util/rexx/royalbridge11.lha Architecture: generic FKeyPlus is a replacement for the system's FKey commodity. It is a MUI application written in ARexx, developed on an A4000/040 with AmigaOS 3.9 + BoingBags 1 & 2, MUI 3.8, RxMUI 42.6, and RoyalBridge 1.1. The "plus" in the name is an innovative pop-up key requester that lets you edit key descriptions without having to type in, or even remember, qualifier and base names. The requester normalizes a key description by decomposing a compound character base into qualifiers and a simple base and then eliminating redundant qualifiers. In a key description with a dashed numericpad qualifier and base key (, ), *, +, or Enter, normalization removes the dash, and with other numeric pad base keys it removes the dash and qualifier. Normalization also removes a dash from the repeat qualifier and removes -upstroke when repeat is included. The requester initially displays the key string contents normalized. The capture feature directly captures and displays key presses (but not mouse button clicks; you retain mouse control of the requester's gadgets and menu). The program fixes several problems with FKey: it processes the CX_PopUp startup argument, relaxes the key description length limit, allows the use of the parameters pop-up file requester with the insert text function, and loads a dropped icon into the parameters string. The program rejects some nonworking key descriptions: an undashed numericpad qualifier with an incompatible base key, and repeat with an undashed upstroke. I use an icon datatype class, util/dtype/IconDT44.lha, so several About windows look a bit prettier. The links in the About requesters use OpenURL, comm/www/openurl.lha. To make the About address link work, in OpenURL preferences I edited my mailer command's address argument so the keyword is joined to its value by a space instead of an equals sign. The equals sign apparently exposes a bug in dos.library/Execute() that assumes an angle bracket indicates a stream redirection. If the program receives options from the command line or from the Cmd tool type, it processes them with the following argument template. Otherwise, it reads its options as tool types with the same keywords. CX_Priority/N/K,CX_PopKey/K,CX_PopUp/S,PubScreen/K CX_PopUp and PubScreen override the corresponding settings in MUI preferences. I might have included CX_PopKey in that statement, but MUI's HotKey setting doesn't work on my system. FKeyPlus is a demonstration of the power of ARexx and RoyalBridge to access arbitrary libraries (in this case commodities.library, exec.library, graphics.library, intuition.library, and keymap.library). By releasing this script, I hope to encourage more development in ARexx. Known Problems Maybe not a problem, but I've noticed that closing FKey's window hides it while it continues to run. FKeyPlus terminates when its window is closed. The key string and pop-up button group is not a true popstring gadget like the parameters popASL gadget and does not support the pop-up key assignment in MUI preferences. FKeyPlus does not support FKey's ARexx features, which I'm told are documented only in the German OS release. It does, however, support the standard MUI ARexx commands. There are some key descriptions that don't work that the program doesn't reject because I haven't figured out all of the rules. For example on my system the single character $ works but < doesn't. But you probably wouldn't assign a key description without a qualifier. There may be further possible normalization I could perform that I haven't figured out. History 1.5 Bug fix: Address fix for 1.3 was broken. 1.4 Bug fix: Failed to capture back apostrophe. Bug fix: Rather than trying to reject key description without base key (which also rejected back apostrophe), base key defaults to back apostrophe. 1.3 Bug fix: Expanded criteria for rejecting key description. Enhanced feature: Expanded key description normalization. Bug fix: Key requester allowed repeat qualifier to be dashed. Bug fix: Key requester displays hyphen base key by doubling it. Bug fix: Restoring key description failed to enable OK button. Bug fix: Mishandled 32-bit memory address values. 1.2 Added feature: Key requester can capture key presses. 1.1 Bug fix: Project > Save menu item was initially enabled. 1.0 First Aminet release. I welcome your comments and questions.