示例#1
0
void unbind_K(xhkEvent e, void *r1, void *config, void *r3)
{
    xhkConfig *hkconfig = (xhkConfig *) config;
    printf("\n--Unbinding 'K' (%i, %i)\n\n", e.keycode, e.modifiers);
    xhkUnBindKey(hkconfig, 0, XK_K, ControlMask | ShiftMask, xhkKeyPress);
    printf("\n\n");
}
示例#2
0
// -----------------------------------------------------------------------------
// Unregister hotkeys
// -----------------------------------------------------------------------------
bool hotkeymanager_unregister_hotkeys(HotkeyManager* hkman)
{
    hklist* item = hkman->hotkeys->next; // get first item
    while (item)
    {
#ifdef _PLAT_WNDS
        if (!UnregisterHotKey(NULL, item->id))
#else
        if (xhkUnBindKey(hkman->hkconfig, 0, item->vk, hkconvert(item->mod),
                         xhkKeyPress) == -1)
#endif // _PLAT_WNDS
            return false;
        else
            hklog("Successfully unregistered hotkey (id: %d)\n", item->id);
        // get next item
        item = item->next;
    }
    
    return true;
}