Use Unicode keysym range as fallback
Not all Unicode codepoints have an equivalent named Keysym. But there is a range in the Keysym namespace that can be used to map any codepoint to.
This commit is contained in:
@@ -38,9 +38,9 @@ describe('Helpers', function() {
|
||||
it('should map characters which aren\'t in Latin1 *or* Windows-1252 to keysyms', function() {
|
||||
expect(keysyms.fromUnicode('ŵ'.charCodeAt())).to.have.property('keysym', 0x1000175);
|
||||
});
|
||||
it('should return undefined for unknown codepoints', function() {
|
||||
expect(keysyms.fromUnicode('\n'.charCodeAt())).to.be.undefined;
|
||||
expect(keysyms.fromUnicode('\u1F686'.charCodeAt())).to.be.undefined;
|
||||
it('should map unknown codepoints to the Unicode range', function() {
|
||||
expect(keysyms.fromUnicode('\n'.charCodeAt())).to.have.property('keysym', 0x100000a);
|
||||
expect(keysyms.fromUnicode('\u{1F686}'.charCodeAt())).to.have.property('keysym', 0x101f686);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user