4 posts
Custom Keybindings Not Working in Windows

Finally made the switch over to 4.1.8 from 4.1.6. I have a custom layer I created with some modal-type keybindings, mostly unchanged from the previous version. I pulled in a bunch (almost all) of the fleury layer because it had a bunch of neat features.

I implemented the layer in Linux; it works fine there. I pulled all the custom code over to Windows and it looks like the modal keybindings aren't getting picked up. I'm not using any of the default bindings nor loading the bindings file. As far as I can tell, I'm following the instructions from the new-ish getting started guide.

It starts out fine in basic editing mode (the 'keys_file' or 'keys_code' mapid), except anything not in the global mapping doesn't seem to be picked up. If I switch to one of my modes (using the command_lister), none of the keybindings work. I know the code is running by stepping through it with VS.

Here's how I'm setting up the keybindings:

    String_ID global_id = vars_save_string_lit("keys_global");
    String_ID file_id = vars_save_string_lit("keys_file");
    String_ID code_id = vars_save_string_lit("keys_code");
    String_ID file_base_id = vars_save_string_lit("keys_file_base");
    mapid_xcom = vars_save_string_lit("keys_xcom");
    mapid_command = vars_save_string_lit("keys_command");
    mapid_insert = vars_save_string_lit("keys_insert");
    BindCore(fleury_startup, CoreCode_Startup);
    BindCore(default_try_exit, CoreCode_TryExit);
    BindCore(clipboard_record_clip, CoreCode_NewClipboardContents);
    Bind(modal_to_xcom, KeyCode_X, KeyCode_Control);
    Bind(exit_4coder,KeyCode_F4, KeyCode_Alt);
    BindMouseWheel(mouse_wheel_change_face_size, KeyCode_Control);
    BindCore(default_try_exit, CoreCode_TryExit);
    Bind(modal_to_command, KeyCode_Escape);
    Bind(modal_to_command, KeyCode_G);
    Bind(MODAL(close_build_panel),             KeyCode_Comma, KeyCode_Alt);
    BindMouse(click_set_cursor_and_mark, MouseCode_Left);
    BindMouseRelease(click_set_cursor, MouseCode_Left);
    BindCore(click_set_cursor_and_mark, CoreCode_ClickActivateView);
    Bind(delete_char,            KeyCode_Delete);
    Bind(view_jump_list_with_lister,  KeyCode_Period, KeyCode_Control, KeyCode_Shift);
    Bind(modal_to_insert, KeyCode_Escape);
    Bind(f4_home, KeyCode_A);
    Bind(move_left,              KeyCode_B);
    Bind(f4_open_project, KeyCode_O, KeyCode_Alt);
    Bind(modal_to_command, KeyCode_Escape);
    Bind(move_left_alpha_numeric_boundary,           KeyCode_Left, KeyCode_Control);
    Bind(move_right_alpha_numeric_boundary,          KeyCode_Right, KeyCode_Control);
    Bind(write_zero_struct,          KeyCode_0, KeyCode_Control);

Anyone know what I'm missing here?

Simon Anciaux
1092 posts
Custom Keybindings Not Working in Windows

Could you share the complete platform layer so I can try to compile and run it ?

Have you tried setting a breakpoint in default_view_input_handler and step in default_implicit_map to verify that map ids are set properly ?

4 posts
Custom Keybindings Not Working in Windows

I figured out my issue. I forgot to copy over the modified 4coder_default_framework.cpp file (as per the getting started guide).

Thank you for your help.