Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js |
— | — | @@ -442,8 +442,16 @@ |
443 | 443 | }; |
444 | 444 | |
445 | 445 | es.SurfaceView.prototype.onKeyDown = function( e ) { |
446 | | - var _this = this; |
447 | 446 | switch ( e.keyCode ) { |
| 447 | + // Tab |
| 448 | + case 9: |
| 449 | + if ( !e.metaKey && !e.ctrlKey && !e.altKey ) { |
| 450 | + this.$input.val( '\t' ); |
| 451 | + this.handleInsert(); |
| 452 | + e.preventDefault(); |
| 453 | + return false; |
| 454 | + } |
| 455 | + return true; |
448 | 456 | // Shift |
449 | 457 | case 16: |
450 | 458 | this.keyboard.keys.shift = true; |
— | — | @@ -538,6 +546,12 @@ |
539 | 547 | break; |
540 | 548 | // Enter |
541 | 549 | case 13: |
| 550 | + if ( this.keyboard.keys.shift ) { |
| 551 | + this.$input.val( '\n' ); |
| 552 | + this.handleInsert(); |
| 553 | + e.preventDefault(); |
| 554 | + return false; |
| 555 | + } |
542 | 556 | this.handleEnter(); |
543 | 557 | e.preventDefault(); |
544 | 558 | break; |