Fixed linux side keyboard stuff

This commit is contained in:
Allen Webster 2016-02-25 20:28:31 -05:00
parent ba04801d6c
commit 145d1a6561
2 changed files with 17 additions and 22 deletions

View File

@ -12,9 +12,7 @@
#include "4ed_keyboard.cpp" #include "4ed_keyboard.cpp"
internal void internal void
keycode_init(Display* dpy, Key_Codes *codes){ keycode_init(Display* dpy){
set_dynamic_key_names(codes);
#if 0 #if 0
// NOTE(inso): these are for XInput, currently not used. // NOTE(inso): these are for XInput, currently not used.
@ -46,18 +44,18 @@ keycode_init(Display* dpy, Key_Codes *codes){
KeySym sym; KeySym sym;
Code code; Code code;
} sym_table[] = { } sym_table[] = {
{ XK_BackSpace, codes->back }, { XK_BackSpace, key_back },
{ XK_Delete, codes->del }, { XK_Delete, key_del },
{ XK_Up, codes->up }, { XK_Up, key_up },
{ XK_Down, codes->down }, { XK_Down, key_down },
{ XK_Left, codes->left }, { XK_Left, key_left },
{ XK_Right, codes->right }, { XK_Right, key_right },
{ XK_Insert, codes->insert }, { XK_Insert, key_insert },
{ XK_Home, codes->home }, { XK_Home, key_home },
{ XK_End, codes->end }, { XK_End, key_end },
{ XK_Page_Up, codes->page_up }, { XK_Page_Up, key_page_up },
{ XK_Page_Down, codes->page_down }, { XK_Page_Down, key_page_down },
{ XK_Escape, codes->esc } { XK_Escape, key_esc }
}; };
const int table_size = sizeof(sym_table) / sizeof(struct SymMapping); const int table_size = sizeof(sym_table) / sizeof(struct SymMapping);

View File

@ -101,8 +101,7 @@ struct Linux_Vars{
XIM input_method; XIM input_method;
XIMStyle input_style; XIMStyle input_style;
XIC input_context; XIC input_context;
Key_Codes key_codes;
Key_Input_Data key_data; Key_Input_Data key_data;
Mouse_State mouse_data; Mouse_State mouse_data;
@ -1630,7 +1629,7 @@ main(int argc, char **argv)
linuxvars.XDisplay = XOpenDisplay(0); linuxvars.XDisplay = XOpenDisplay(0);
keycode_init(linuxvars.XDisplay, &linuxvars.key_codes); keycode_init(linuxvars.XDisplay);
#ifdef FRED_SUPER #ifdef FRED_SUPER
char *custom_file_default = "4coder_custom.so"; char *custom_file_default = "4coder_custom.so";
@ -1796,8 +1795,7 @@ main(int argc, char **argv)
XSetWMProtocols(linuxvars.XDisplay, linuxvars.XWindow, &WM_DELETE_WINDOW, 1); XSetWMProtocols(linuxvars.XDisplay, linuxvars.XWindow, &WM_DELETE_WINDOW, 1);
} }
linuxvars.app.init(linuxvars.system, &linuxvars.target, linuxvars.app.init(linuxvars.system, &linuxvars.target, &memory_vars, &exchange_vars,
&memory_vars, &exchange_vars, &linuxvars.key_codes,
linuxvars.clipboard_contents, current_directory, linuxvars.clipboard_contents, current_directory,
linuxvars.custom_api); linuxvars.custom_api);
@ -1929,7 +1927,7 @@ main(int argc, char **argv)
case MappingNotify: { case MappingNotify: {
if(Event.xmapping.request == MappingModifier || Event.xmapping.request == MappingKeyboard){ if(Event.xmapping.request == MappingModifier || Event.xmapping.request == MappingKeyboard){
XRefreshKeyboardMapping(&Event.xmapping); XRefreshKeyboardMapping(&Event.xmapping);
keycode_init(linuxvars.XDisplay, &linuxvars.key_codes); keycode_init(linuxvars.XDisplay);
} }
}break; }break;
@ -2057,7 +2055,6 @@ main(int argc, char **argv)
u64 start_time = system_time(); u64 start_time = system_time();
linuxvars.app.step(linuxvars.system, linuxvars.app.step(linuxvars.system,
&linuxvars.key_codes,
&input_data, &input_data,
&mouse, &mouse,
&linuxvars.target, &linuxvars.target,