wmii/liblitz/kb.c

29 lines
584 B
C
Raw Normal View History

2005-11-18 18:54:58 +03:00
/*
2006-01-20 17:20:24 +03:00
* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
2005-11-18 18:54:58 +03:00
* See LICENSE file for license details.
*/
#include <string.h>
#include "blitz.h"
2005-12-05 01:45:59 +03:00
unsigned long blitz_strtomod(char *val)
2005-11-18 18:54:58 +03:00
{
2005-12-05 01:45:59 +03:00
unsigned long mod = 0;
if (strstr(val, "Shift"))
2005-11-18 18:54:58 +03:00
mod |= ShiftMask;
if (strstr(val, "Control"))
2005-11-18 18:54:58 +03:00
mod |= ControlMask;
if (strstr(val, "Mod1") || strstr(val, "Alt"))
2005-11-18 18:54:58 +03:00
mod |= Mod1Mask;
if (strstr(val, "Mod2"))
2005-11-18 18:54:58 +03:00
mod |= Mod2Mask;
if (strstr(val, "Mod3"))
2005-11-18 18:54:58 +03:00
mod |= Mod3Mask;
if (strstr(val, "Mod4"))
2005-11-18 18:54:58 +03:00
mod |= Mod4Mask;
if (strstr(val, "Mod5"))
2005-11-18 18:54:58 +03:00
mod |= Mod5Mask;
return mod;
}