Tie message ID strings to function keys

for classic and classic_caps keyboards.
This commit is contained in:
Dave 2021-12-04 23:53:15 -06:00
parent 68086cde31
commit 03069fc8b5
5 changed files with 29 additions and 10 deletions

View File

@ -61,9 +61,6 @@ void setup_apple2_caps_keymap(void)
asdf_hook_assign(APPLESOFT_KEYBOARD_TEST, applesoft_keyboard_test);
asdf_hook_assign(APPLE2_CAPS_ID_MESSAGE, apple2_caps_id_message);
asdf_virtual_init();
// Turn the POWER LED on and don't assign to any function
asdf_virtual_assign(APPLE_VIRTUAL_POWER_LED, APPLE_POWER_LED, V_NOFUNC, APPLE_POWER_LED_INIT_VALUE);

View File

@ -23,12 +23,18 @@
// this program. If not, see <https://www.gnu.org/licenses/>.
//
#include "asdf.h"
#include "asdf_keymaps.h"
#include "asdf_virtual.h"
#include "asdf_modifiers.h"
#include "asdf_print.h"
#include "asdf_keymap_classic.h"
#include "asdf_keymap_classic_add_map.h"
#include "asdf_keymap_apple2_add_map.h"
void classic_id_message(void) {
asdf_print("[Keymap: classic]\n");
}
// PROCEDURE:
// INPUTS:
@ -47,14 +53,15 @@
void setup_classic_keymap(void)
{
asdf_print("[Keymap: classic]\n");
asdf_set_print_delay(ASDF_CLASSIC_PRINT_SPEED); //msec
classic_add_map(CLASSIC_PLAIN_MAP, MOD_PLAIN_MAP);
classic_add_map(CLASSIC_CAPS_MAP, MOD_CAPS_MAP);
classic_add_map(CLASSIC_SHIFT_MAP, MOD_SHIFT_MAP);
classic_add_map(CLASSIC_CTRL_MAP, MOD_CTRL_MAP);
asdf_virtual_init();
asdf_hook_assign(CLASSIC_ID_MESSAGE_HOOK, classic_id_message);
asdf_hook_assign(APPLESOFT_KEYBOARD_TEST_HOOK, applesoft_keyboard_test);
// Assign power LED to virtual power LED, and initialize to ON
asdf_virtual_assign(CLASSIC_VIRTUAL_POWER_LED, CLASSIC_POWER_LED, V_NOFUNC, CLASSIC_POWER_LED_INIT_VALUE);
@ -62,6 +69,7 @@ void setup_classic_keymap(void)
// Assign CAPS LED to virtual CAPS LED, and initialize to the INIT value, to
// match the initial CAPSLOCK state. The capslock state code will alter the
// virtual LED according to the state.
asdf_virtual_assign(VCAPS_LED, CLASSIC_CAPS_LED, V_NOFUNC, CLASSIC_CAPS_LED_INIT_VALUE);
// assign RESET output to the virtual RESET output, configure to produce a short pulse when activated
@ -69,7 +77,6 @@ void setup_classic_keymap(void)
// assign the CLRSCR output to the virtual CLRSCR output, configure to produce a long pulse when activated
asdf_virtual_assign(CLASSIC_VIRTUAL_CLR_SCR, CLASSIC_CLR_SCR_OUT, V_PULSE_LONG, !CLASSIC_CLR_SCR_ACTIVE_VALUE);
}

View File

@ -31,8 +31,7 @@
#if !defined(ASDF_KEYMAP_DEFS_CLASSIC_H)
#define ASDF_KEYMAP_DEFS_CLASSIC_H
// include DIP switch definitions
#include "asdf_keymap_defs_dipswitch.h"
#include "asdf_hook.h"
// Edit the number of rows and columns used in this map. If the number is less
// than the maxium, the unused elements will be initialized to 0.
@ -59,6 +58,11 @@
#define CLASSIC_CAPS_LED PHYSICAL_LED3
#define CLASSIC_CAPS_LED_INIT_VALUE 0
#define CLASSIC_ID_MESSAGE_HOOK ASDF_HOOK_USER_10
#define APPLESOFT_KEYBOARD_TEST_HOOK ASDF_HOOK_USER_9
#define ASDF_CLASSIC_PRINT_SPEED 40
#endif /* !defined (ASDF_KEYMAP_DEFS_ASCII_H) */
//-------|---------|---------+---------+---------+---------+---------+---------+

View File

@ -29,6 +29,7 @@
#include "asdf_keymaps.h"
#include "asdf_keymap_classic.h"
#include "asdf_keymap_classic_add_map.h"
#include "asdf_keymap_defs_dipswitch.h"
// Key Matrix for combination of ASCII controller and Classic ASCII matrix
//

View File

@ -23,12 +23,21 @@
// this program. If not, see <https://www.gnu.org/licenses/>.
//
#include "asdf.h"
#include "asdf_keymaps.h"
#include "asdf_print.h"
#include "asdf_virtual.h"
#include "asdf_modifiers.h"
#include "asdf_keymap_classic.h"
#include "asdf_keymap_classic_add_map.h"
#include "asdf_keymap_apple2_add_map.h"
void classic_caps_id_message(void) {
asdf_print("[Keymap: classic]\n");
}
// PROCEDURE:
// INPUTS:
@ -47,7 +56,7 @@
void setup_classic_caps_keymap(void)
{
asdf_print("[Keymap: classic CAPS]");
asdf_set_print_delay(ASDF_CLASSIC_PRINT_SPEED);
// for the ALL CAPS keymap, the "plain" mode is the same as "all caps" mode:
classic_add_map(CLASSIC_CAPS_MAP, MOD_PLAIN_MAP);
@ -55,7 +64,8 @@ void setup_classic_caps_keymap(void)
classic_add_map(CLASSIC_SHIFT_MAP, MOD_SHIFT_MAP);
classic_add_map(CLASSIC_CTRL_MAP, MOD_CTRL_MAP);
asdf_virtual_init();
asdf_hook_assign(CLASSIC_ID_MESSAGE_HOOK, classic_caps_id_message);
asdf_hook_assign(APPLESOFT_KEYBOARD_TEST_HOOK, applesoft_keyboard_test);
// Assign power LED to virtual power LED, and initialize to ON
asdf_virtual_assign(CLASSIC_VIRTUAL_POWER_LED, CLASSIC_POWER_LED, V_NOFUNC, CLASSIC_POWER_LED_INIT_VALUE);