Exemple #1
0
/**
 * Check which Shortcut key is pressed/released.
 * If press is set, store the key array index.
 * Return zero if key didn't match to a shortcut
 */
int ShortCut_CheckKeys(int modkey, int symkey, bool press)
{
    SHORTCUTKEYIDX key;

    if (modkey & (KMOD_RALT|KMOD_LMETA|KMOD_RMETA|KMOD_MODE))
        key = ShortCut_CheckKey(symkey, ConfigureParams.Shortcut.withModifier);
    else
        key = ShortCut_CheckKey(symkey, ConfigureParams.Shortcut.withoutModifier);

    if (key == SHORTCUT_NONE)
        return 0;
    if (press)
        ShortCutKey = key;
    return 1;
}
Exemple #2
0
/**
 * Check which Shortcut key is pressed/released.
 * If press is set, store the key array index.
 * Return zero if key didn't match to a shortcut
 */
int ShortCut_CheckKeys(int modkey, int symkey, bool press)
{
	SHORTCUTKEYIDX key;

#if defined(__APPLE__)
    if ((modkey&(KMOD_RCTRL|KMOD_LCTRL)) && (modkey&(KMOD_RALT|KMOD_LALT)))
#else
	if (modkey & (KMOD_RALT|KMOD_LGUI|KMOD_RGUI|KMOD_MODE))
#endif
		key = ShortCut_CheckKey(symkey, ConfigureParams.Shortcut.withModifier);
	else
		key = ShortCut_CheckKey(symkey, ConfigureParams.Shortcut.withoutModifier);

	if (key == SHORTCUT_NONE)
		return 0;
	if (press) {
		ShortCutKey = key;
		fprintf(stderr,"Short :%x\n",ShortCutKey);
	}
	return 1;
}