Accented Characters Popup!

Just noticed something in Mavericks which I never even knew existed:
If you press and hold the letter s for example - a popup showing alternative accented characters is displayed.

I usually spend ages looking for accented characters - now it is done automatically :slight_smile:
I only found this by mistake :slight_smile:

Thats one of those little things that on OS X you get for free and it works in the code editor because we rewrote it using the TextInputCanvas

You cannot get that to work exactly right using a canvas subclass

The Formatted Text Control takes all that into account. Kind of a pain but it’s nice to get that for ‘free’ in a canvas subclass.

TextInputCanvas subclass :stuck_out_tongue:

Interesting. I have that in an old Google phone ; and it is the same in iOS. Long Tap is coming to desktop computing :slight_smile:

this isn’t a tap

Has come, not is coming :slight_smile:

OK. Terminology for UI user actions ;

  • iOS/Android : tap a key and hold until a popup shows all accented characters to select one by tap
  • Mac OS X : press a key and hold until a popup shows all accented characters to select one by press

I just observed iOS and Android seemed to have influenced Mac OS X. Long press, hold, anything really ; whatever suits you best …

Norman, how can we use that in our own projects? What are the proper steps to compile and use it? Are there more detailed instructions somewhere?

It is the OS that supplies the functionality, not Xojo.

Sorry Kem, no luck on Windows.

I figured the additional features like the accent pop-ups and additional editing keys were supplied by MacOS, but would expect the plug-in to be cross-platform.

At any rate, I’d like to try it out but downloading the project and hitting “Build” didn’t seem to do anything for me.

(BTW, I’m not sure why you’re sorry since I’m running MacOS here.)

From Bob’s website at http://www.bkeeneybriefs.com/2013/06/xojo-2013-release-1/:

The Xojo code editor is mostly the same as the Real Studio code editor in appearance and functionality. In reality it’s a completely rewritten editor mainly because the entire IDE is a Cocoa application (on Mac OS X, of course). The code editor is a canvas subclass and in Cocoa applications the canvas control cannot get the same keyboard input as regular text fields. This led to the creation of the Text Input Canvas plugin that lets Cocoa applications get the same level of keyboard information (more on this later) for non-text controls (i.e. the canvas).

Text Input Canvas Plugin

Cocoa is a different beast in many ways when it comes to text and keyboard handling. Carbon applications give you a bunch of additional information for free as part of Apple Text Services that gives you (for free) special character handling. Unfortunately in Cocoa this mechanism is completely gone.

We’ve already talked about how the Code Editor is a special canvas subclass. It was suffering from the lack of information and there was no way around it. Xojo Inc has produced a new open source plugin that allows you get all of the events you need to capture special text handling. It does this by introducing a number of new events that your canvas subclass will have to take care of.

P.S. And I’m sorry because I assume you want it cross-platform. Same here with the drawer and ShowModalWithin …

Thanks for that link. The way it makes it sound, the control it provides is cross-platform, but the additional features like accent handling must be handled in code.

I’d still like to find out how to compile it to see for myself.

https://forum.xojo.com/2309-formatted-text-control-3-1/0

StyledText in Xojo can be a royal pain - especially in Cocoa builds. The fact that it doesn’t support many rtf standards (like inline graphics and hyperlink text to name a few) make it less than desirable for many developers. This is where the Formatted Text Control comes in for many. It’s a canvas subclass control that is a Word Processor and reads/writes/supports more of the RTF standard than the TextArea control. Unfortunately, when building for Cocoa, we lost much of the text handling we came to know and expect in Carbon applications. This meant that international languages weren’t fully supported in Cocoa.

This week Xojo released the Text Input Canvas plugin (see the links in my blog post) that allows the Canvas control to receive the proper text events to work. The Text Input plugin is a Xojo-only, open-source plugin that works in Cocoa, Windows, and Linux.

Version 3.1 of the Formatted Text Control takes advantage of the plugin thus bringing it up to speed in Cocoa. I believe it’s also the first commercial application to take advantage of this technology outside of the IDE itself (since the Code Editor is a Canvas subclass). We’ve released version 3.1 as an alpha so all version 3 owners can start integrating it into their Cocoa applications.

3.1 is a free upgrade to all version 3 owners and is a paid upgrade for all previous versions. Note that 3.1 is NOT backwards compatible with Real Studio.

More info at http://www.bkeeneybriefs.com/2013/06/formatted-text-control-3-1-0-alpha-1/

That had the link to the plugin, thanks.

You base a custom control on TextInputCanvas

[quote=83491:@Kem Tekinay]Thanks for that link. The way it makes it sound, the control it provides is cross-platform, but the additional features like accent handling must be handled in code.
[/quote]
You get it for free mostly

Is there an example project available?

Looks like it hasn’t been put on github

Hopefully it will because, at first glance, I can’t make heads nor tails on how to use it.