1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-02-02 14:31:13 +00:00

Keyrah: Use LCtrl+LAmiga+LAmiga for Minimig reset.

This commit is contained in:
sorgelig
2016-12-23 06:28:21 +08:00
parent 62b6aead5e
commit 3d4bf9eaa6
3 changed files with 12 additions and 6 deletions

View File

@@ -654,7 +654,15 @@ static void usb_process_iface (usb_hid_iface_info_t *iface,
// boot kbd needs at least eight bytes
if(read >= 8) {
//Keyrah v2: USB\VID_18D8&PID_0002\A600/A1200_MULTIMEDIA_EXTENSION_VERSION
if((iface->conf.vid == 0x18D8) && (iface->conf.pid == 0x0002)) keyrah_trans(buf, buf+2);
if((iface->conf.vid == 0x18D8) && (iface->conf.pid == 0x0002))
{
keyrah_trans(buf, buf+2);
check_reset(buf[0], 0);
}
else
{
check_reset(buf[0], 1);
}
user_io_kbd(buf[0], buf+2, UIO_PRIORITY_KEYBOARD);
}
}

View File

@@ -1379,10 +1379,10 @@ unsigned short keycode(unsigned char in) {
return MISS;
}
void check_reset(unsigned char modifiers) {
void check_reset(unsigned char modifiers, char useAlt) {
if((core_type == CORE_TYPE_MINIMIG) ||
(core_type == CORE_TYPE_MINIMIG2)) {
if(modifiers == 0x45) // ctrl - alt - alt
if(modifiers == (useAlt ? 0x45 : 0x89)) // ctrl - alt - alt / ctrl - amiga - amiga
OsdReset(RESET_NORMAL);
}
}
@@ -1533,9 +1533,6 @@ void user_io_kbd(unsigned char m, unsigned char *k, uint8_t priority) {
for(i=0;i<8;i++) {
// Do we have a downstroke on a modifier key?
if((m & (1<<i)) && !(modifier & (1<<i))) {
// check for special events in modifier presses
check_reset(m);
// shift keys are used for mouse joystick emulation in emu mode
if(((i != EMU_BTN1) && (i != EMU_BTN2) &&
(i != EMU_BTN3) && (i != EMU_BTN4)) || (emu_mode == EMU_NONE))

View File

@@ -158,6 +158,7 @@ void user_io_eth_send_rx_frame(uint8_t *, uint16_t);
void user_io_eth_receive_tx_frame(uint8_t *, uint16_t);
// hooks from the usb layer
void check_reset(unsigned char modifiers, char useAlt);
void user_io_mouse(unsigned char b, char x, char y);
void user_io_kbd(unsigned char m, unsigned char *k, uint8_t priority);
char user_io_create_config_name(char *s);