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;
|
2006-02-01 23:22:55 +03:00
|
|
|
if (strstr(val, "Shift"))
|
2005-11-18 18:54:58 +03:00
|
|
|
mod |= ShiftMask;
|
2006-02-01 23:22:55 +03:00
|
|
|
if (strstr(val, "Control"))
|
2005-11-18 18:54:58 +03:00
|
|
|
mod |= ControlMask;
|
2006-02-01 23:22:55 +03:00
|
|
|
if (strstr(val, "Mod1") || strstr(val, "Alt"))
|
2005-11-18 18:54:58 +03:00
|
|
|
mod |= Mod1Mask;
|
2006-02-01 23:22:55 +03:00
|
|
|
if (strstr(val, "Mod2"))
|
2005-11-18 18:54:58 +03:00
|
|
|
mod |= Mod2Mask;
|
2006-02-01 23:22:55 +03:00
|
|
|
if (strstr(val, "Mod3"))
|
2005-11-18 18:54:58 +03:00
|
|
|
mod |= Mod3Mask;
|
2006-02-01 23:22:55 +03:00
|
|
|
if (strstr(val, "Mod4"))
|
2005-11-18 18:54:58 +03:00
|
|
|
mod |= Mod4Mask;
|
2006-02-01 23:22:55 +03:00
|
|
|
if (strstr(val, "Mod5"))
|
2005-11-18 18:54:58 +03:00
|
|
|
mod |= Mod5Mask;
|
|
|
|
return mod;
|
|
|
|
}
|