Hyper: can't write accented characters on a portuguese keyboard

Created on 6 Jul 2016  路  8Comments  路  Source: vercel/hyper

This sentence here

Note that composed characters (those that require multiple keystrokes) are not currently supported by this mode.

https://chromium.googlesource.com/apps/libapps/+/HEAD/nassh/doc/FAQ.md#How-do-I-enter-accented-characters

suggests this is not possible using hterm

any has any idea how to solve this?

Bug In Progress

Most helpful comment

Also its not possible write characters ~ and ' in hyperterm on keyboard EUA - INTERNATIONAL - PC (Macbook)

All 8 comments

image

We might need to revisit how input is being captured right now by hterm. It relies on key events, which are not capable of themselves triggering composition modals (like the emoji window).

Instead, I think it'd be interesting to explore inserting a tiny contenteditable <div> inside the caret div, and capture events inside it. That way, when composition happens, the modal will be displayed where the user expects.

馃憤 to this one. I can't type @ in the swedish keyboard =) (also can't put emojis)

@rauchg I played around with capturing user input through an always focused hidden input but got stuck on capturing backspace and enter keystrokes, but I didn't try too hard to be honest

@nfcampos we might want to try keypress + composition events on that input (https://developer.mozilla.org/en-US/docs/Web/Events/compositionstart). The input has to be placed in the caret, not be altogether hidden, otherwise the emoji dialog will show out of place.

We might be able to do without adding any element. I've tried just making the current x-row element (current as in the one the cursor is in) contenteditable and it appears to work (sort of)

// this could maybe be ran every time something is written to the terminal
this.term.screen_.rowsArray.map((row, i) => {
  if (i === this.term.getCursorRow())
    row.contentEditable = true;
  else
    row.contentEditable = false;
})
  • this makes the emoji dialog appear in the right place (as long as that x-row has focus, we can probably give it focus when you click anywhere in the terminal, it already gains focus as soon as you type anything)

screenshot 2016-07-07 23 45 03

  • clicking an emoji inserts a bunch of gibberish, but there's probably something we can do to fix that
  • accents do appear but when I type a letter after hitting the accent key (which would normally insert the accented letter, eg. 谩) gibberish appears (the same gibberish that appears if I paste the same accented character to the terminal

screenshot 2016-07-07 23 49 05
screenshot 2016-07-07 23 51 01

  • and obviously we'd have to remove that hideous blue outline

@rauchg do you know what to do about getting rid of the gibberish and writing the actual characters/emojis to the terminal?

Also its not possible write characters ~ and ' in hyperterm on keyboard EUA - INTERNATIONAL - PC (Macbook)

Nor ", , ', 藴 or accentuated characters with US International. That means, no: 谩茅铆贸煤盲毛茂枚眉脿猫矛貌霉帽脩盲毛'"~. It won't show gibberish, just won't write the special-chars and for vocals will just write them plain.

Same here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alejandrofloresm picture alejandrofloresm  路  3Comments

cilice picture cilice  路  3Comments

juicygoose picture juicygoose  路  3Comments

cooperpellaton picture cooperpellaton  路  3Comments

ghost picture ghost  路  3Comments