mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-10 18:29:44 +00:00
BII/SS common: read keycodes, if failed, read BasiliskII_keycodes
This commit is contained in:
parent
b3c4d46ca9
commit
946f4bb77d
@ -90,19 +90,13 @@ enum {
|
|||||||
static int display_type = DISPLAY_WINDOW; // See enum above
|
static int display_type = DISPLAY_WINDOW; // See enum above
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SHEEPSHAVER
|
|
||||||
#define PREFIX ""
|
|
||||||
#else
|
|
||||||
#define PREFIX "BasiliskII_"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
#ifdef WIN32
|
#if defined(__MACOSX__) || defined(WIN32)
|
||||||
const char KEYCODE_FILE_NAME[] = PREFIX "keycodes";
|
const char KEYCODE_FILE_NAME[] = "keycodes";
|
||||||
#elif __MACOSX__
|
const char KEYCODE_FILE_NAME2[] = "BasiliskII_keycodes";
|
||||||
const char KEYCODE_FILE_NAME[] = PREFIX "keycodes";
|
|
||||||
#else
|
#else
|
||||||
const char KEYCODE_FILE_NAME[] = DATADIR "/keycodes";
|
const char KEYCODE_FILE_NAME[] = DATADIR "/keycodes";
|
||||||
|
const char KEYCODE_FILE_NAME[] = DATADIR "/BasiliskII_keycodes";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -1207,6 +1201,7 @@ static void keycode_init(void)
|
|||||||
|
|
||||||
// Open keycode table
|
// Open keycode table
|
||||||
FILE *f = fopen(kc_path && *kc_path ? kc_path : KEYCODE_FILE_NAME, "r");
|
FILE *f = fopen(kc_path && *kc_path ? kc_path : KEYCODE_FILE_NAME, "r");
|
||||||
|
if (f == NULL) f = fopen(KEYCODE_FILE_NAME2, "r");
|
||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
char str[256];
|
char str[256];
|
||||||
snprintf(str, sizeof(str), GetString(STR_KEYCODE_FILE_WARN), kc_path ? kc_path : KEYCODE_FILE_NAME, strerror(errno));
|
snprintf(str, sizeof(str), GetString(STR_KEYCODE_FILE_WARN), kc_path ? kc_path : KEYCODE_FILE_NAME, strerror(errno));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user