creating_20function_20key_20macros
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
creating_20function_20key_20macros [2018/03/31 13:19] – external edit 127.0.0.1 | creating_20function_20key_20macros [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 15: | Line 15: | ||
HKEY_CURRENT_USER\Software\R T Russell\BBC BASIC for Windows\Macros\F12 | HKEY_CURRENT_USER\Software\R T Russell\BBC BASIC for Windows\Macros\F12 | ||
When one of the keys is pressed the corresponding Registry entry is checked, and if present the macro string stored there is executed.\\ \\ The string associated with a particular macro can be of any (reasonable) length and contains the usual 8-bit (ANSI) character codes corresponding to the required sequence of key-presses. Any character which can be obtained from the keyboard (including those which require the **Shift** and/or **Ctrl** keys to be pressed) may be included in the string. However, character codes which cannot be directly obtained from the keyboard must __not__ be included.\\ \\ So to program the **F12** key to generate **Hello world!** one could use the following simple program: | When one of the keys is pressed the corresponding Registry entry is checked, and if present the macro string stored there is executed.\\ \\ The string associated with a particular macro can be of any (reasonable) length and contains the usual 8-bit (ANSI) character codes corresponding to the required sequence of key-presses. Any character which can be obtained from the keyboard (including those which require the **Shift** and/or **Ctrl** keys to be pressed) may be included in the string. However, character codes which cannot be directly obtained from the keyboard must __not__ be included.\\ \\ So to program the **F12** key to generate **Hello world!** one could use the following simple program: | ||
+ | <code bb4w> | ||
Macro12$ = "Hello world!" | Macro12$ = "Hello world!" | ||
Line 23: | Line 24: | ||
SYS " | SYS " | ||
ENDIF | ENDIF | ||
+ | </ | ||
Of course there are several keyboard keys which do not generate characters, but which either modify the action of other keys (e.g. **Shift**, **Ctrl**, **Alt**) or have special actions such as cursor movement or Escape. The function keys themselves are in this category. It is possible to incorporate these keys into a macro string using the special values **CHR$0** or **CHR$255** followed immediately by the [[http:// | Of course there are several keyboard keys which do not generate characters, but which either modify the action of other keys (e.g. **Shift**, **Ctrl**, **Alt**) or have special actions such as cursor movement or Escape. The function keys themselves are in this category. It is possible to incorporate these keys into a macro string using the special values **CHR$0** or **CHR$255** followed immediately by the [[http:// | ||
+ | <code bb4w> | ||
Alt_Down$ = CHR$0+CHR$18 | Alt_Down$ = CHR$0+CHR$18 | ||
Alt_Up$ = CHR$255+CHR$18 | Alt_Up$ = CHR$255+CHR$18 | ||
Line 36: | Line 39: | ||
SYS " | SYS " | ||
ENDIF | ENDIF | ||
+ | </ | ||
This corresponds to the following sequence of keyboard operations: | This corresponds to the following sequence of keyboard operations: | ||
Line 45: | Line 49: | ||
- Press Enter (activate the OK button) | - Press Enter (activate the OK button) | ||
\\ Note that you should always use the **press** and **release** codes in pairs, so the macro leaves the ' | \\ Note that you should always use the **press** and **release** codes in pairs, so the macro leaves the ' | ||
+ | <code bb4w> | ||
Alt_Down$ = CHR$0+CHR$18 | Alt_Down$ = CHR$0+CHR$18 | ||
Alt_Up$ = CHR$255+CHR$18 | Alt_Up$ = CHR$255+CHR$18 | ||
Line 57: | Line 62: | ||
SYS " | SYS " | ||
ENDIF | ENDIF | ||
+ | </ | ||
The corresponding keyboard sequence is as follows:\\ \\ | The corresponding keyboard sequence is as follows:\\ \\ | ||
creating_20function_20key_20macros.1522502353.txt.gz · Last modified: 2024/01/05 00:18 (external edit)