int mask = 0;
if (masksMap.containsKey(keyCode)) {
mask = masksMap.get(keyCode);
} else {
for (int i = 0; i < maskBits.length; i++) {
BitStack stack = maskBits[i];
if (!stack.isFull()) {
if (JXAenvUtils._debug) {
System.err.println("adding new keycode " + keyCode + " to stack " + i);
}
masksMap.put(keyCode, mask = i + stack._newBit(_VK_bits));
codesMap.put(mask, keyCode);
break;
}
}
}