New Post: Opportunistic Word Completion

I have read the css code from the repo and modified my custom gtk.css file to properly apply to this keyboard, and it looks great.

The non-css code from the repo is confusing to me.

I don’t understand how to modify the positions of keys on the various layouts. Can this be done in a similar way to Sqeekboard, in which it is possible to modify a YAML file and place it in ~/.local/squeekboard/keyboards/ directory, or is there another way in which to modify the layouts for this phosh-osk-stub keyboard? I see that .json files are used for the layouts, but I don’t know how to apply my own custom layout.

I also wonder if modifying existing files is enough to be able to create the keyboard that I want to create (based on MessagEase), or if I will need to learn how to create code in non-css languages to accomplish this.

3 Likes

As the new year approaches, I know many people are busy with other things (like celebrating), but I want to ask again if anyone has any understanding of how to modify keyboard layouts for the phosh-osk-stub keyboard.

@guido.gunther, when you are less busy, would you please help me to understand some things about your amazing keyboard? I’m really showing my ignorance here, but I am completely lost on how to modify it at all (except for gtk color themes), and I would appreciate any help on the matter.

If anyone else has anything to share about this keyboard, please do.

1 Like

No, but I suspect @Ick may know more and/or has interest in the matter.

1 Like

Note that modifying layouts isn’t one of p-o-s goals at the moment so you’ll be way more happy with squeekboard in that regard. That said you can use G_RESOURCE_OVERLAY (which is a generic glib mechanism to overlay gresources) to overlay your own layouts without recompiling. I don’t have an example at hand but Avoiding notches · Phosh explains how to use G_RESOURCE_OVERLAY for notch information. It’s similar for the osk layout’s json file.

4 Likes

Not for this specific case - at least not yet. I also have not the time to dig into it any time soon (need to finish the other projects + higher priority non L5 projects).

1 Like

Should I start in this thread to integrate a Thai layout into phosh-osk-stub? Or do I start here?: Phosh's On Screen Keyboard Interface · Phosh

1 Like

@guido.gunther

1 Like

I have been unsuccessful in trying to do this. Has anyone else tried this?

I also still do not understand where to begin the process of creating a swipe keyboard. I thought that my first step would be simply modifying the layout of this keyboard, but I can’t even do that. I also don’t know if single keys can contain multiple secondary characters or if the secondary characters can be repositioned.

Ideally, I would like to set each key to have secondary characters such that each one is triggered by a swipe in a specific direction, with respect to the main key that contains it. Since the phosh-osk-stub keyboard supports secondary characters and swiping (on the spacebar), I feel that it is a better base for modifications than the default Sqeekboard keyboard.

If anyone would like to help with any of this, please do; otherwise, I am at a standstill.

1 Like

If you look for swipe you need to code (either by modifying p-o-s or starting your own thing).

Developing for Mobile Linux with Phosh - Part 0: Running nested · Phosh explains how to get a development set up on your Laptop/PC. Use that and treat phosh-osk-stub as the application you want to test, build it from source and run it in the nested session. Then look at how pos-osk-widget.c handles the gestures.

EDIT: you can use either squeekboard or p-o-s as a base as the gestures are supported by GTK which is used by both.

(I’m not following the forums atm so please excuse when not getting further replies).

4 Likes

Quick question - I tried this and it looks good but I don’t use a QWERTY layout. Is there a way of changing the layout to another standard or is that coming?

1 Like

The install isn’t working for me.

I am on byzantium. I added the repo, did the install of phosh-osk-stub, then did update-alternative. but I had to use sudo to change alternative. I am still seeing the squeekboard osk. Even after reboot.

what am I missing?

1 Like

There are three options after using the command, so input 2 when prompted, then restart thereafter:

sudo update-alternatives --config Phosh-OSK
There are 2 choices for the alternative Phosh-OSK (providing /usr/share/applications/sm.puri.OSK0.desktop).

  Selection    Path                                                     Priority   Status
------------------------------------------------------------
* 0            /usr/share/applications/sm.puri.Squeekboard.desktop       50        auto mode
  1            /usr/share/applications/sm.puri.Squeekboard.desktop       50        manual mode
  2            /usr/share/phosh-osk-stub/sm.puri.Phosh.OskStub.desktop   30        manual mode

I just tried that and I’m still getting the squeekboard keyboard?! Any other tests I can try to see whats happening.

I should say, I have a customized layout using files in my .local directory. Do I need to remove that directory?

1 Like

No, you don’t need to remove that directory. The phosh-osk-stub keyboard doesn’t use the same configuration files as Squeekboard, so they don’t apply at all when switching.

I’m not sure what is causing your issue though.

1 Like

Ok, I realized the problem. @FranklyFlawless I was thinking of the screenshot you showed for the alternatives config and automatically setting #2 as you mentioned.

I just tried it again, and realized the options are different now. This is what showed up on my phone:

There are 3 choices for the alternative Phosh-OSK (providing /usr/share/applications/sm.puri.OSK0.desktop).

Selection Path Priority Status

0 /usr/share/applications/sm.puri.Squeekboard.desktop 50 auto mode
1 /usr/share/applications/sm.puri.OSK0-legacy.desktop 20 manual mode
2 /usr/share/applications/sm.puri.Squeekboard.desktop 50 manual mode

  • 3 /usr/share/phosh-osk-stub/sm.puri.Phosh.OskStub.desktop 30 manual mode

Press to keep the current choice[*], or type selection number:

So, I had to select #3 now to use the Phosh-OSK Stub. Not sure if anyone else noticed this change, but the alternatives menu is different than what was posted previously.

I am getting the new keyboard now. Thanks for everyone’s help.

5 Likes

If the data is local, what is the starting point, is it part of the os or kb package?

Then is autocorrect/suggest data built up by the user over time?

1 Like

Glad I wondered into this. Is it something I should be doing?
Is the “need to add” for all Byzantium users or just those beta testing Crimson?

1 Like

No, byzantium-updates-proposed provides newer package versions for phosh-osk-stub.

1 Like

Whatever is going on with a "phosh’ I’ll take that as a no…
Thanks.

1 Like

I also do not use auto correct because in my experience it “auto corrects” to a word I was not trying for and was totally different in meaning!

4 Likes