window: Use loop instead of multiple ifs
Binds modifier's mask and key, also fixes a compile time warning
spotted by clang:
warning: cast from 'gchar *' (aka 'char *') to 'guint *' (aka 'unsigned
int *') increases required alignment from 1 to 4 [-Wcast-align]
return (guint*)g_array_free(a, FALSE);