mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-12-24 18:31:51 +00:00
Set/synchronize CAPSLOCK from X11
This commit is contained in:
parent
8414a37025
commit
58041f5105
@ -52,7 +52,7 @@ extern int raw_js_y;
|
||||
|
||||
static int next_key = -1;
|
||||
static int last_scancode = -1;
|
||||
static char caps_lock = 1; /* is enabled */
|
||||
bool caps_lock = false; /* is enabled */
|
||||
static bool in_interface = false;
|
||||
|
||||
/* ----------------------------------------------------
|
||||
@ -165,11 +165,6 @@ void c_handle_input(int scancode, int pressed)
|
||||
{
|
||||
last_scancode = scancode;
|
||||
|
||||
if (key_pressed[ SCODE_CAPS ])
|
||||
{
|
||||
caps_lock = !caps_lock;
|
||||
}
|
||||
|
||||
if ((key_pressed[ SCODE_L_SHIFT ] || key_pressed[ SCODE_R_SHIFT ]) &&
|
||||
(key_pressed[ SCODE_L_CTRL ] || key_pressed[ SCODE_R_CTRL ]))
|
||||
{
|
||||
|
@ -137,6 +137,7 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
extern pthread_mutex_t interface_mutex;
|
||||
extern bool caps_lock;
|
||||
|
||||
#ifdef PC_JOYSTICK
|
||||
extern int js_fd;
|
||||
|
@ -556,6 +556,11 @@ void video_sync(int block) {
|
||||
// also process other input events
|
||||
post_image();
|
||||
|
||||
// sync to the capslock state (which could be modified outside this app)
|
||||
unsigned int caps_state = 0;
|
||||
XkbGetIndicatorState(display, XkbUseCoreKbd, &caps_state);
|
||||
caps_lock = (caps_state & 0x01);
|
||||
|
||||
bool keyevent = true;
|
||||
do {
|
||||
if (doShm)
|
||||
|
Loading…
Reference in New Issue
Block a user