Moved the mouse uncapture key combination to variables for future reconfigurability.
This commit is contained in:
@@ -29,6 +29,21 @@
|
|||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
int keyboard_scan;
|
int keyboard_scan;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
/* Windows: F8+F12 */
|
||||||
|
uint16_t key_prefix_1 = 0x042; /* F8 */
|
||||||
|
uint16_t key_prefix_2 = 0x000; /* Invalid */
|
||||||
|
uint16_t key_uncapture_1 = 0x058; /* F12 */
|
||||||
|
uint16_t key_uncapture_2 = 0x000; /* Invalid */
|
||||||
|
#else
|
||||||
|
/* WxWidgets cannot do two regular keys.. CTRL+END */
|
||||||
|
uint16_t key_prefix_1 = 0x01d; /* Left Ctrl */
|
||||||
|
uint16_t key_prefix_2 = 0x11d; /* Right Ctrl */
|
||||||
|
uint16_t key_uncapture_1 = 0x04f; /* Numpad End */
|
||||||
|
uint16_t key_uncapture_2 = 0x14f; /* End */
|
||||||
|
#endif
|
||||||
|
|
||||||
void (*keyboard_send)(uint16_t val);
|
void (*keyboard_send)(uint16_t val);
|
||||||
|
|
||||||
static int recv_key[512]; /* keyboard input buffer */
|
static int recv_key[512]; /* keyboard input buffer */
|
||||||
@@ -350,15 +365,10 @@ keyboard_isfsexit_up(void)
|
|||||||
return (!recv_key[0x01d] && !recv_key[0x11d] && !recv_key[0x038] && !recv_key[0x138] && !recv_key[0x051] && !recv_key[0x151]);
|
return (!recv_key[0x01d] && !recv_key[0x11d] && !recv_key[0x038] && !recv_key[0x138] && !recv_key[0x051] && !recv_key[0x151]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do we have F8-F12 in the keyboard buffer? */
|
/* Do we have the mouse uncapture combination in the keyboard buffer? */
|
||||||
int
|
int
|
||||||
keyboard_ismsexit(void)
|
keyboard_ismsexit(void)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
return ((recv_key[key_prefix_1] || recv_key[key_prefix_2]) &&
|
||||||
/* Windows: F8+F12 */
|
(recv_key[key_uncapture_1] || recv_key[key_uncapture_2]));
|
||||||
return (recv_key[0x042] && recv_key[0x058]);
|
|
||||||
#else
|
|
||||||
/* WxWidgets cannot do two regular keys.. CTRL+END */
|
|
||||||
return ((recv_key[0x01D] || recv_key[0x11D]) && (recv_key[0x04F] || recv_key[0x14F]));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@@ -146,13 +146,19 @@ extern int enable_discord; /* (C) enable Discord integration */
|
|||||||
|
|
||||||
extern int fixed_size_x;
|
extern int fixed_size_x;
|
||||||
extern int fixed_size_y;
|
extern int fixed_size_y;
|
||||||
extern double mouse_sensitivity; /* (C) Mouse sensitivity scale */
|
extern double mouse_sensitivity; /* (C) Mouse sensitivity scale */
|
||||||
#ifdef _Atomic
|
#ifdef _Atomic
|
||||||
extern _Atomic double mouse_x_error; /* Mouse error accumulator - Y */
|
extern _Atomic double mouse_x_error; /* Mouse error accumulator - Y */
|
||||||
extern _Atomic double mouse_y_error; /* Mouse error accumulator - Y */
|
extern _Atomic double mouse_y_error; /* Mouse error accumulator - Y */
|
||||||
#endif
|
#endif
|
||||||
extern int pit_mode; /* (C) force setting PIT mode */
|
extern int pit_mode; /* (C) force setting PIT mode */
|
||||||
extern int fm_driver; /* (C) select FM sound driver */
|
extern int fm_driver; /* (C) select FM sound driver */
|
||||||
|
|
||||||
|
/* Keyboard variables for future key combination redefinition. */
|
||||||
|
extern uint16_t key_prefix_1;
|
||||||
|
extern uint16_t key_prefix_2;
|
||||||
|
extern uint16_t key_uncapture_1;
|
||||||
|
extern uint16_t key_uncapture_2;
|
||||||
|
|
||||||
extern char exe_path[2048]; /* path (dir) of executable */
|
extern char exe_path[2048]; /* path (dir) of executable */
|
||||||
extern char usr_path[1024]; /* path (dir) of user data */
|
extern char usr_path[1024]; /* path (dir) of user data */
|
||||||
|
Reference in New Issue
Block a user