Skip to content

Commit

Permalink
feat: add new line on shift+enter on the Virtual Keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
arnog committed Sep 3, 2023
1 parent 64ca447 commit 5bbbf43
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

### Improvements

- Added support for additional commands from the `mathtools` , `actuarialangle`, `colonequals`, `statmath` and `amsopn` packages
- Added support for additional commands from the `mathtools`, `actuarialangle`, `colonequals`, `statmath` and `amsopn` packages
- Added support for `longdiv` enclosure (`\mathenclose{longdiv}{...}`)
- The decimal separator key (`.`) in the virtual keyboard was displayed as a blank key.
- **#2109** In the virtual keyboard, some placeholders could be hard to see when
Expand All @@ -30,6 +30,9 @@
- Improved serialization to ASCIIMath and MathML
- **#2121** For ASCIIMath and MathML serialization, including phantom closing
delimiter in the output.
- Pressing the Action keycap on the virtual keyboard with the shift key pressed
now inserts a new line (similar to what shift+enter does on a physical keyboard).


## 0.95.5 (2023-08-18)

Expand Down
12 changes: 10 additions & 2 deletions src/virtual-keyboard/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,9 @@ const SVG_ICONS = `<svg xmlns="http://www.w3.org/2000/svg" style="display: none;
<path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>
</symbol>
<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>
<symbol id="svg-command" viewBox="0 0 640 512">
<path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>
</symbol>
Expand Down Expand Up @@ -710,14 +713,19 @@ const KEYCAP_SHORTCUTS: Record<string, Partial<VirtualKeyboardKeycap>> = {
},
},
'[return]': {
class: 'action',
class: 'action hide-shift',
command: ['performWithFeedback', 'commit'],
shift: { command: ['performWithFeedback', 'addRowAfter'] },
width: 1.5,
label: '<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>',
},
'[action]': {
class: 'action',
class: 'action hide-shift',
command: ['performWithFeedback', 'commit'],
shift: {
label: '<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>',
command: ['performWithFeedback', 'addRowAfter'],
},
width: 1.5,
label: '<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>',
},
Expand Down

0 comments on commit 5bbbf43

Please sign in to comment.