#include <map>
+#include <stdexcept>
#ifdef WIN32
#include <windows.h>
#else
#include <X11/X.h>
#include <X11/keysym.h>
#endif
-#include <msp/core/except.h>
#include "keys.h"
using namespace std;
#endif
};
-unsigned modmap[Msp::Input::N_MODS_]=
-{
-#ifndef WIN32
- ShiftMask, ControlMask, Mod1Mask, Mod4Mask
-#else
- 1, 2, 4, 8
-#endif
-};
-
}
namespace Msp {
unsigned key_to_sys(unsigned key)
{
if(key>=N_KEYS_)
- throw InvalidParameterValue("Key out of range");
+ throw invalid_argument("key_to_sys");
return keymap[key];
}
-unsigned mod_from_sys(unsigned mod)
-{
- unsigned result = 0;
- for(unsigned i=0; i<N_MODS_; ++i)
- if(mod&modmap[i])
- result |= 1<<i;
- return result;
-}
-
} // namespace Input
} // namespace Msp