Unexpected-Keyboard icon indicating copy to clipboard operation
Unexpected-Keyboard copied to clipboard

Italic/Bold/Smallcaps

Open hoemich opened this issue 5 months ago • 6 comments

I don't know - is it possible to add layers, to type italic, bold or in small caps, if the input field accepts rich input?

That would be a phenomenal addition.

hoemich avatar Aug 11 '25 08:08 hoemich

UNICODE contains characters in special renditions, such as typewriter-style. Not all fonts include these characters, but the device may be able to render them in a font that does.

Unexpected might offer a mode in which characters are mapped to alternates: 5→⑤ etc. But I wouldn't want Unexpected to try to figure out if I'm typing into a website that uses Markdown, Wikicode, HTML, or modified HTML like some message boards, and to "do what I meant."

Spike-from-NH avatar Aug 11 '25 09:08 Spike-from-NH

No, I did not mean, that the keyboard should detect whatever markup language might be used somewhere and start adding -tags or stuff like that.

My idea was more, to add a switch, so typed letters are inserted, as if they were copied and pasted with formatting from a document, in which their typeface was bold or italic. If the input accepts pasting with formatting, great - otherwise, it would be dropped automatically, wouldn't it?

hoemich avatar Aug 12 '25 23:08 hoemich

Certainly not. If Unexpected determines it is being used on a Tapatalk forum, in which the Start Bold code is [B], but is actually used to type into the Wikipedia editor, which needs ''', the former code doesn't just go away.

If you reply, look at the top line of the edit box. H B I achieve highlighting. Why is it a good idea to move this user interface inside Unexpected?

Spike-from-NH avatar Aug 13 '25 08:08 Spike-from-NH

I don't want to insist that such a feature would be a good idea! It might be a terrible one. You are right: Most of the time, when formatting is supported, there are some buttons in the UI; And it should be the UI developers responsibility to make those functions accessible. But often they fail me, and those buttons are outside of my small phone screen. Also each UI might have a different look and feel, to which I need to adapt. Having the keyboard to provide formatting hints would give me a uniform UI for formatting tasks, and independent from failures in the UI design to adapt to different screen sizes.

I also don't know about the feasibility of such feature. I get the feeling, that it becomes more frequent, that input fields accept formatting from copy-paste content and use their own logic to map the formatting hints to whatever tags or magic sequences they require. Whether a uniform standard for formatted input exists, I don't know. In the MS realm, FORMATETC seems to be used. Whether this is adopted by Linux and Android applications, or whether they use a different method, I don't know. I also don't know, if FORMATETC is usable for writing on the go, or only applicable to copy-paste content.

As you see, I really don't know much about, how keyboard input is provided to input fields.

hoemich avatar Aug 13 '25 09:08 hoemich

If what you want is a remedy for apps that don't give you ways to type strings you use often, you should try adding a custom layout so your copy of Unexpected can type arbitrary strings with a single gesture.

Spike-from-NH avatar Aug 13 '25 16:08 Spike-from-NH

The clipboard with formatting idea seems good. It's possible without changing the user's clipboard with commitContent. We can theoretically send HTML formatted text and detect whether the text field supports it.

I'm not sure this feature would be used by everyone but I'm often surprised. Anyone willing to investigate how to integrate this to the keyboard ?

Julow avatar Aug 16 '25 16:08 Julow