+import KeyTable from "./keysym.js";
import keysyms from "./keysymdef.js";
import vkeys from "./vkeys.js";
import fixedkeys from "./fixedkeys.js";
location = 0;
}
+ // The original Meta key now gets confused with the Windows key
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1020141
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1232918
+ if (key === 'Meta') {
+ let code = getKeycode(evt);
+ if (code === 'AltLeft') {
+ return KeyTable.XK_Meta_L;
+ } else if (code === 'AltRight') {
+ return KeyTable.XK_Meta_R;
+ }
+ }
+
return DOMKeyTable[key][location];
}
expect(KeyboardUtil.getKeysym({code: 'AltRight', key: 'Alt', location: 2})).to.be.equal(0xFFEA);
expect(KeyboardUtil.getKeysym({code: 'AltRight', key: 'AltGraph', location: 2})).to.be.equal(0xFE03);
});
+ it('should handle Meta/Windows distinction', function () {
+ expect(KeyboardUtil.getKeysym({code: 'AltLeft', key: 'Meta', location: 1})).to.be.equal(0xFFE7);
+ expect(KeyboardUtil.getKeysym({code: 'AltRight', key: 'Meta', location: 2})).to.be.equal(0xFFE8);
+ expect(KeyboardUtil.getKeysym({code: 'MetaLeft', key: 'Meta', location: 1})).to.be.equal(0xFFEB);
+ expect(KeyboardUtil.getKeysym({code: 'MetaRight', key: 'Meta', location: 2})).to.be.equal(0xFFEC);
+ });
it('should return null for unknown keys', function () {
expect(KeyboardUtil.getKeysym({key: 'Semicolon'})).to.be.null;
expect(KeyboardUtil.getKeysym({key: 'BracketRight'})).to.be.null;