Paired Symbol Automation & Shortcuts (e.g., ⁠¿?⁠ and ⁠¡!⁠)

Done Typing & autocorrect fixed in 2.2.1

Garux TESTER ·

Streamline the insertion of paired punctuation marks used in Spanish and other languages through two potential implementation methods:

  1. Quick Shortcut / Smart Insertion:

When tapping the opening symbol (e.g., ⁠¿⁠), the keyboard automatically inserts both the opening and closing marks (⁠¿?⁠) and places the cursor right in between: ⁠¿|?⁠.

Text Selection Wrapping: If text is highlighted beforehand, tapping the opening symbol automatically wraps the selected word or phrase (e.g., selecting "hello" and pressing ⁠¿⁠ produces ⁠¿hello?⁠).

  1. Language-Based Automation:

When set to Spanish or another language using paired punctuation, the keyboard dynamically context-detects interrogative or exclamatory phrasing, auto-suggesting or inserting the corresponding opening mark at the appropriate position.

User Benefit:

Saves multiple taps and eliminates the need to continuously switch back and forth between the alphabetical and symbol layouts, significantly boosting typing speed in Spanish.

Discussion

efko DEV ·

@Garux here's how I'd build it. Tell me if it works for you before I start.

The letter page has no ¿ key and I don't want to add one, because on small phones it would squeeze the other keys. For Spanish I'd put ¿ and ¡ in the long-press menu of the period key. You hold the period, slide to ¿, and get ¿|? with the cursor in the middle. When you type ? at the end it doesn't double up. The cursor just steps over the one that's already there. Backspace right after inserting removes both. With text selected, ¿ wraps it: hello becomes ¿hello?. Same for ¡!. A switch in settings turns the pairing off.

For the automatic part I'd only suggest, not insert. When the first word of a sentence is a question word (qué, cómo, dónde, por qué…), the suggestion bar offers ¿Cómo and one tap adds the ¿. Inserting it automatically would also hit sentences like "Como te dije…" that aren't questions. For ¡ I don't see a reliable way to spot an exclamation from the first word, so that one stays manual.

Would long-pressing the period work for you, or do you need ¿ on a single tap?

Garux TESTER ·

Thanks for the detailed response! Your approach with the long-press on the period key is a really smart way to keep the layout clean. The behavior for auto-pairing, backspacing, and text wrapping sounds amazing.

Also, the suggestion bar logic is excellent—for me, the fewer taps I have to make, the better, so being able to just tap a suggested question word and get the opening mark automatically with a single tap sounds super comfortable. I'd love to test it out!

efko DEV ·

@Garux it's done for build 445, and it'll be in 2.2 on the App Store. In Spanish, hold the period for ¿ and ¡: you get ¿|? with the cursor in the middle, typing ? at the end steps over it, and with text selected it wraps it. When a sentence starts with a question word, the bar offers ¿Cómo, and the switch is in Typing settings as Paired ¿? and ¡!.

Garux TESTER ·

Wow, that was insanely fast! It works like a charm—even better than I expected. The pairing and cursor placement feel super seamless. I’ll keep testing it throughout the day and let you know if I notice anything else. Huge thanks for implementing this!

efko DEV ·
status → Needs testing
Ed MOD ·

comment deleted

Ed MOD · · edited

cool, typing ¿ ends up in ¿? With the cursor in between.

Ed MOD ·

¡! This one works too!

Ed MOD ·

this is what I want:

¿Cómo estamos hoy? me preguntó él, después de preguntarme: ¿cómo está tu novia hoy?

But this is what I typed:

Cómo estamos hoy? me preguntó él, después de preguntarme: cómo está tu novia hoy?

Now I selected the first part before the question mark, the cursor went everywhere but then it couldn't pinpoint what to do and I received the message attached

efko DEV ·

@Ed a selection at the start of a sentence made the keyboard walk through the whole field to double-check it, that's the cursor jumping around, and in Safari that check didn't work out, so it changed nothing. The ? right after your selection would also have doubled. Fixed for build 460 and in 2.2.1 on the App Store: the selection is checked right at the cursor, ¿ wraps it straight away, and the ? that's already there stays the only one.

efko DEV ·
status → Reopened
efko DEV ·
status → Needs testing
Ed MOD ·

I'm not sure if the function that you built was supposed to read the whole text, instead of just the part that I selected. Look what happens in the video. No words needed I say.

Next, differently, in this sentence it should automatically put está in, in this specific context

efko DEV ·

@Ed it should only check the selection, not the whole note. Yours ran to the very end of the note, the check tried to step one character past the end, Notes ignored that, and the keyboard fell back to reading the whole note. Fixed for build 461 and in 2.2.1 on the App Store: a selection at the end of a note is checked right where it is, so the cursor no longer runs through the text. About está: the video shows NL EN on the space bar, so Spanish wasn't active and nothing could change esta to está.

Ed MOD ·
status → Reopened
efko DEV ·
status → Needs testing
Ed MOD ·

Thanks @efko .

I don't know why in EFKEY I’m always struggling to quickly see if it’s ES NL or EN NL. On iPhone native keyboard I’ve never encountered this. Is is because the font size is different? Or the position on the spacebar? Or me? I don't know

Ed MOD · · edited

Tested. For those who know what they're doing, it works perfectly fine. There are 2 maybe 3 edge cases, see videos. One: selecting a sentence that already got the question marks, the behavior differs when entering? Or ¿. Then while typing this text I saw that something else happened. See third video. All edge cases though

efko DEV · · edited

@Ed the ¿ only checked the selection itself, so with a ¿ already right before it you got ¿¿. Fixed for build 462 and in 2.2.1 on the App Store: it's no longer doubled. The ? replacing a selection is normal, only ¿ and ¡ wrap it, and the cursor runs in Notes because it only shows the keyboard the paragraph you're in. For a lone ¿, delete the ? or turn off Paired ¿? and ¡!.

Ed MOD ·
status → Reopened
efko DEV ·
status → Needs testing
Ed MOD ·

Hi Efko, got it! I guess that you meant that the fix is in 462 right? Not 461. Because I tested this in 461 @efko

efko DEV ·

@Ed yes, my mistake, it's 462. 461 went out before this fix, so what you saw there is exactly the ¿¿ it fixes.

efko DEV ·

@Ed Does it work?

Ed MOD ·

O sorry I tested this and it works. Guess I forgot to log it.

Ed MOD ·
status → Done

Sign in to comment or vote.