Skip to content
Snippets Groups Projects
Commit 3bad8ecf authored by deuce's avatar deuce
Browse files

Fix mouse support in X11 output mode. This has been broken for quite a while.

Reported by Aapo Rantalainen (Thanks!)
parent 108dd1be
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,7 @@
#endif
#include "ciolib.h"
#include "keys.h"
#include "x_cio.h"
#include "x_events.h"
......@@ -152,6 +153,18 @@ int x_get_window_info(int *width, int *height, int *xpos, int *ypos)
return(0);
}
/* Mouse event/keyboard thread */
void x11_mouse_thread(void *data)
{
//uint16_t key=((CIO_KEY_MOUSE&0xFF)<<8)|((CIO_KEY_MOUSE>>8)&0xFF);
uint16_t key=CIO_KEY_MOUSE;
while(1) {
if(mouse_wait())
write(key_pipe[1], &key, 2);
}
}
int x_init(void)
{
dll_handle dl;
......@@ -360,6 +373,7 @@ int x_init(void)
}
_beginthread(x11_event_thread,1<<16,NULL);
_beginthread(x11_mouse_thread,1<<16,NULL);
sem_wait(&init_complete);
if(!x11_initialized) {
sem_destroy(&pastebuf_set);
......
......@@ -754,13 +754,8 @@ static int x11_event(XEvent *ev)
break;
}
if (scan != 0xffff) {
unsigned char ch;
ch=scan & 0xff;
write(key_pipe[1], &ch, 1);
if(!ch) {
ch=scan >> 8;
write(key_pipe[1], &ch, 1);
}
uint16_t key=scan;
write(key_pipe[1], &key, (scan&0xff)?1:2);
}
return(1);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment