Fixed linux side keyboard stuff

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

View File

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