Customized punctuation in lexical model

I edited the model.ts file so that when predictive text is selected, I wouldn’t have a space after the word. This works except now I have to tap the Space bar twice if I do want to create a space after the word. I observed this on both Android and iOS devices. Can anything be done about this?

@Friedo, welcome to the community!

I’m not clear if this is related to the model or to the keyboard itself. Normally, the model doesn’t impact the behaviour of the space bar – only to the suggestions given on the top. Can you provide a little more detail so I can understand this?

Hi Marc,
Thanks for your reply.
I am referring to these instructions
It says at the bottom under " Customizing insertAfterWord" that it’s possible to suppress the space after the word. I thought that this refers to the space that is automatically inserted in the text after the predictive word is selected in the bar. I managed to do this by changing the code to

So now the user can, for example, type a comma or a full stop or add suffixes to the word without having to push the space bar. That’s what we want because it’s useful in this language. However, if the user (after inserting a predicted word into the text) wants to type a space, they need to hit the space bar twice. The first tap on the space bar doesn’t do anything. I wonder if this could be changed so the first tap on the space bar would indeed create a space.

Okay, I’ve found some time to download and test your keyboard + model. I am able to observe the problem, and note that it is not limited to your keyboard – it appears to be a bug in Keyman which I can see with any keyboard + model. I am opening this as an issue for further investigation.

Thanks a lot for looking at it and adding it to the list.

You’re welcome – good news is you should be able to go ahead and publish your keyboard and this fix will come through in an update to Keyman without needing any involvement from you.

Okay, yes that’s good news. Do you know when it would be? I was actually thinking to go back to the original setting (automatic space after the predictive word) and submitting the change later, after the bug is fixed.

That may not be a bad idea. We never got to implement particularly adaptive behavior here; that behavior is admittedly designed for use with automatic spaces. While you can customize the inserted punctuation, we haven’t yet implemented the ability to customize interactions with that punctuation.

We have time allotted in our roadmap a few months out to enhance areas like this, assuming that the plan is to allow these optimizations to be generalized for use under conditions like these; it’ll take some time to properly design.