String[] parts = str.split("\\+");
int modifiers = 0;
for (int i = 0; i < parts.length - 1; i++) {
Integer m = MODIFIER_NAME_MAP.get(constCase(parts[i]));
if (m == null) {
throw new CommandSyntaxException(String.format(ex_unknown_mod, parts[i]));
}
modifiers |= m;
}
Integer vk = VK_NAME_MAP.get(constCase(parts[parts.length - 1]));
if (vk == null) {
throw new CommandSyntaxException(String.format(ex_unknown_vkey, parts[parts.length - 1]));
}
return new VirtualKey(vk, modifiers);
}