From 3d4bf9eaa67de40f79adece9fd64a585236f2ea7 Mon Sep 17 00:00:00 2001 From: sorgelig Date: Fri, 23 Dec 2016 06:28:21 +0800 Subject: [PATCH] Keyrah: Use LCtrl+LAmiga+LAmiga for Minimig reset. --- usb/hid.c | 10 +++++++++- user_io.c | 7 ++----- user_io.h | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/usb/hid.c b/usb/hid.c index df6eb2a..1383054 100644 --- a/usb/hid.c +++ b/usb/hid.c @@ -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); } } diff --git a/user_io.c b/user_io.c index c50f16b..d36ec2a 100644 --- a/user_io.c +++ b/user_io.c @@ -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<