|
|
|
|
@ -13,6 +13,13 @@ var to_normalize = [
|
|
|
|
|
var unshifted = "` 1 2 3 4 5 6 7 8 9 0 - = q w e r t y u i o p [ ] \\ a s d f g h j k l ; ' z x c v b n m , . /";
|
|
|
|
|
// shifted = '~ ! @ # $ % ^ & * ( ) _ + Q W E R T Y U I O P { } | A S D F G H J K L : " Z X C V B N M < > ?';
|
|
|
|
|
|
|
|
|
|
var ambiguous_expect = function(ch){
|
|
|
|
|
// `-` is ambiguous in shortcut context as a separator, so map it to `minus`
|
|
|
|
|
if(ch === '-'){
|
|
|
|
|
return 'minus';
|
|
|
|
|
}
|
|
|
|
|
return ch;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
casper.notebook_test(function () {
|
|
|
|
|
var that = this;
|
|
|
|
|
@ -24,7 +31,7 @@ casper.notebook_test(function () {
|
|
|
|
|
var sc2 = IPython.keyboard.event_to_shortcut(e);
|
|
|
|
|
return sc2;
|
|
|
|
|
}, item);
|
|
|
|
|
this.test.assertEquals(result, item, 'Shortcut to event roundtrip: '+item);
|
|
|
|
|
this.test.assertEquals(result, ambiguous_expect(item), 'Shortcut to event roundtrip: '+item);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|