예제 #1
0
파일: gui.cpp 프로젝트: Julien-B/aseprite
Accelerator* add_keyboard_shortcut_to_quicktool(const char* shortcut_string, tools::Tool* tool)
{
    Shortcut* shortcut = get_keyboard_shortcut_for_quicktool(tool);
    if (!shortcut) {
        shortcut = new Shortcut(Shortcut::Type::EditorQuicktool);
        shortcut->tool = tool;

        shortcuts->push_back(shortcut);
    }

    shortcut->add_shortcut(shortcut_string);
    return shortcut->accel;
}
예제 #2
0
파일: gui.cpp 프로젝트: Julien-B/aseprite
Accelerator* add_keyboard_shortcut_to_spriteeditor(const char* shortcut_string, const char* action_name)
{
    Shortcut* shortcut = get_keyboard_shortcut_for_spriteeditor(action_name);
    if (!shortcut) {
        shortcut = new Shortcut(Shortcut::Type::SpriteEditor);
        shortcut->action = action_name;

        shortcuts->push_back(shortcut);
    }

    shortcut->add_shortcut(shortcut_string);
    return shortcut->accel;
}
예제 #3
0
파일: gui.cpp 프로젝트: Julien-B/aseprite
Accelerator* add_keyboard_shortcut_to_execute_command(const char* shortcut_string,
        const char* command_name, Params* params, KeyContext keyContext)
{
    Shortcut* shortcut = get_keyboard_shortcut_for_command(command_name, params);
    if (!shortcut) {
        shortcut = new Shortcut(Shortcut::Type::ExecuteCommand);
        shortcut->command = CommandsModule::instance()->getCommandByName(command_name);
        shortcut->params = params ? params->clone(): new Params;
        shortcut->keycontext = keyContext;
        shortcuts->push_back(shortcut);
    }
    shortcut->add_shortcut(shortcut_string);
    return shortcut->accel;
}