1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00

Slightly expands list of recognised Intelligent Keyboard commands.

This commit is contained in:
Thomas Harte 2019-11-03 21:58:15 -05:00
parent befe2c2929
commit eeafdf2c03
2 changed files with 28 additions and 1 deletions

View File

@ -151,7 +151,11 @@ void IntelligentKeyboard::dispatch_command(uint8_t command) {
case 0x11: resume(); break;
case 0x12: disable_mouse(); break;
case 0x13: pause(); break;
case 0x1a: disable_joysticks(); break;
case 0x14: set_joystick_event_mode(); break;
case 0x15: set_joystick_interrogation_mode(); break;
case 0x16: interrogate_joysticks(); break;
case 0x1a: disable_joysticks(); break;
}
// There was no premature exit, so a complete command sequence must have been satisfied.
@ -330,5 +334,21 @@ void IntelligentKeyboard::reset_all_buttons() {
// MARK: - Joystick Output
void IntelligentKeyboard::disable_joysticks() {
joystick_mode_ = JoystickMode::Disabled;
}
void IntelligentKeyboard::set_joystick_event_mode() {
joystick_mode_ = JoystickMode::Event;
}
void IntelligentKeyboard::set_joystick_interrogation_mode() {
joystick_mode_ = JoystickMode::Interrogation;
}
void IntelligentKeyboard::interrogate_joysticks() {
output_bytes({
0xfd,
0x00,
0x00
});
}

View File

@ -121,6 +121,13 @@ class IntelligentKeyboard:
// MARK: - Joystick.
void disable_joysticks();
void set_joystick_event_mode();
void set_joystick_interrogation_mode();
void interrogate_joysticks();
enum class JoystickMode {
Disabled, Event, Interrogation
} joystick_mode_ = JoystickMode::Event;
};
}