Custom keyboard

Interested in using the many environmental add-ons and extensions from LiveCode and third parties to the flexible LiveCode environment? This is the place to talk about it.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

trags3
Posts: 305
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

Custom keyboard

Post by trags3 » Wed Nov 06, 2019 6:12 am

It is pretty easy to generate a custom keyboard for a Livecode App but is it possible to generate a custom keyboard in LiveCode for use with other Apps such as WhatsApp?
Thanks,
Tom

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3803
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Custom keyboard

Post by richmond62 » Wed Nov 06, 2019 9:57 am

I doubt it as LiveCode does not seem to be able to send key commands to other applications.

bogs
Posts: 3992
Joined: Sat Feb 25, 2017 10:45 pm

Re: Custom keyboard

Post by bogs » Wed Nov 06, 2019 10:24 am

Although I haven't experimented with doing what your talking about, I think what you'd be looking for is the "read from process" and "write to process" commands, along with the "open Process" and "close process" to initiate the program you'd be making this keyboard for..
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3803
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Custom keyboard

Post by richmond62 » Wed Nov 06, 2019 4:28 pm

Possibly misunderstanding this . . . :D

Tried this:

Code: Select all

on mouseUp
   open process "/Applications/Audacity/Contents/MacOS/Audacity"
end mouseUp
and Audacity did not start.

Equally:

Code: Select all

on mouseUp
   open process Audacity
end mouseUp
Note: On OS X systems, you can use the open process command to start up an application, but not a Unix process. To work with a Unix process, use the shell func instead.
That's the LiveCode Dictionary.

bogs
Posts: 3992
Joined: Sat Feb 25, 2017 10:45 pm

Re: Custom keyboard

Post by bogs » Thu Nov 07, 2019 12:23 am

Dunno, here on 'nix, I used the code listed in the dictionary and applied it to Mousepad ( a text editor, I can't really see needing a 'keystroke' from your program to work on something else ).

Mousepad launched immediately through the open process command. I did *not* get as far as actually sending keystrokes, but I only had 10 minutes before I had to leave.

Maybe some of the longer timers have done something similar, and will delight us with stories of years gone by :D
Image

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7017
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Custom keyboard

Post by FourthWorld » Thu Nov 07, 2019 12:56 am

The OP mentioned WhatsApp, so I'm assuming this is for mobile. Doable, but probably not in LC Script exclusively. Will likely need hooks to lower-level APIs in the OS, which might be doable with LC Builder, depending on whether the packaging requirements for keyboards are different than for other apps.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bogs
Posts: 3992
Joined: Sat Feb 25, 2017 10:45 pm

Re: Custom keyboard

Post by bogs » Thu Nov 07, 2019 1:19 am

I'll take your assumption, and raise you a "guess your right!" Never heard of whats app, but then, I don't own or do mobile either. Just found out through the searchy thingie that it is a facebook thang, which I don't do either :P but, being a messenger and cross platform, I'd guess it has a desktop variation you could test with, and, if you get it working there, you *might* then package it and test it on a whatever you using thingie :twisted:
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3803
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Custom keyboard

Post by richmond62 » Thu Nov 07, 2019 8:43 am

Whatsapp (which I use to communicate with my Mum) is NOT a "facebook thang," it is an app
that belongs to a family of apps that allow voice-calls and text messages: others include
Viber, Signal, Threema, Telegram, Wire and Riot.IM.

If Whatsapp is a "facebook thang," it is only insofar as Facebook own Whatsapp.

https://en.wikipedia.org/wiki/WhatsApp

There are what are called "Whatsapp clients" for Macintosh, Windows and (unofficially) Linux.

I regularly use the Macintosh one and the Linux one as fiddling around with my muckle thumbs
on a telephone keyboard is horrible.

HOWEVER, these 'clients' can only work when your telephone is open and near to your computer
as, somehow, the work you do with the client is routed through your telephone.
I'd guess it has a desktop variation you could test with, and, if you get it working there, you *might* then package it and test it on a whatever you using thingie :twisted:
I wonder who is going to be the next person to be accused of being snide and sarcastic?

SparkOut
Posts: 2029
Joined: Sun Sep 23, 2007 4:58 pm

Re: Custom keyboard

Post by SparkOut » Thu Nov 07, 2019 8:52 am

I am also going to assume the OP wants a custom keyboard for typing into mobile apps. (Although desktop clients are available, it is a more typical use-case on mobile. Plus, what sort of custom keyboard would you program in LC for a desktop app?) Presumably if that's the case (mobile) then sandboxing would be another barrier if the keyboard was created and installed just as a basic LiveCode app.
I would guess you would need to install and register the app as a keyboard in the device settings. I wonder if that is possible under LCB hooking into low level APIs as Richard said.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3803
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Custom keyboard

Post by richmond62 » Thu Nov 07, 2019 8:54 am

what sort of custom keyboard would you program in LC for a desktop app?
That strange Scottish person who lives in Bulgaria would love to, so that end-users could use his Devawriter Pro to type
directly into something like a LibreOffice Writer document . . . . 8)

bogs
Posts: 3992
Joined: Sat Feb 25, 2017 10:45 pm

Re: Custom keyboard

Post by bogs » Thu Nov 07, 2019 10:52 am

richmond62 wrote:
Thu Nov 07, 2019 8:43 am
Whatsapp (which I use to communicate with my Mum) is NOT a "facebook thang,"
richmond62 wrote:
Thu Nov 07, 2019 8:43 am
If Whatsapp is a "facebook thang," it is only insofar as Facebook own Whatsapp.
You make an interesting distinction on when to consider something to be something else. My take, no matter *how* it started out or *what* it is used for, IF company xyz owns it, it is a company xyz thang. I don't know how you could see it as anything else.

It is a messenger? OK, then it is currently a facebook messenger service. Yahoo had one. Aim had one. Microsoft had one, then bought someone elses and, from all I understand, mostly killed off some of the spectacular parts of it. And there are a ton of devs that have made multi-tool versions that can tie into those hosted platforms, as well as others.
richmond62 wrote:
Thu Nov 07, 2019 8:43 am
I'd guess it has a desktop variation you could test with, and, if you get it working there, you *might* then package it and test it on a whatever you using thingie :twisted:
I wonder who is going to be the next person to be accused of being snide and sarcastic?
I've already been. For what it is worth, in the last thread where you were taken to be, I thought the poster was WAY out of line. From what I read, your answers looked to be generously helpful. I can't imagine how they were bent to be sarcastic, unlike many posts where you seem to go out of your way to bend the nail.

Myself, I never claimed not to be sarcastic, and on occasion my nickname might be changed to "Snidely Whiplash", I just try to not make it mean spirited snide sarcasm, despite my 'twisted-evil' smile :P :twisted:

Heck, just a few posts back, RG thought I was tracking his posts down just to harangue him. Purely my fault, for not finding a better way to express myself.
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3803
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Custom keyboard

Post by richmond62 » Thu Nov 07, 2019 11:06 am

Heck, just a few posts back
Well:

1. Some people, let's call them the "meThree" people, are just looking for something to justify some of their own behaviour. 8)

2. Some people are just plain ungrateful for help when it is offered: especially when it does not either:

2.1. solve their problem straight away.

2.2. does not fit their preconceptions as to what constitutes help.

3. Those people who start going on about 'snide' and 'sarcastic' should go away and take a course in reader-response theory.
I can't imagine how they were bent to be sarcastic, unlike many posts where you seem to go out of your way to bend the nail.
I DO often make a point of trying "to bend the nail" (a lovely turn of phrase I have never come across before) because, sometimes,
I feel "the nail" has got a bit too set in its way, and those ways are not helping: and, as we all know, it takes a blacksmith with
a socking great hammer to "bend the nail." The fact that when I do attempt "to bend the nail" (Wow: I can't get enough of that phrase),
there is often a violent "blowback" could be taken as a signal that I have touched the nerve I set out to touch.

Of course, having successfully made a name for myself as "Sh*t-stirrer #1," that sh*t sticks under all circumstances, especially
in the minds of people not given to subtle thinking. 8)

AND, this has got nothing to do whatsoever with custom keyboards, so let's stop "all this" at this point, and get back on-topic. :D
Last edited by richmond62 on Thu Nov 07, 2019 11:14 am, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3803
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Custom keyboard

Post by richmond62 » Thu Nov 07, 2019 11:08 am

no matter *how* it started out or *what* it is used for, IF company xyz owns it, it is a company xyz thang
Quite possibly.

What I would understand by a "facebook thang" is that, quite apart from being owned by Facebook, it was also,
in some way linked to Facebook: i.e. sharing data or somesuch.

bogs
Posts: 3992
Joined: Sat Feb 25, 2017 10:45 pm

Re: Custom keyboard

Post by bogs » Thu Nov 07, 2019 11:15 am

richmond62 wrote:
Thu Nov 07, 2019 11:08 am
What I would understand by a "facebook thang" is that, quite apart from being owned by Facebook, it was also,
in some way linked to Facebook: i.e. sharing data or somesuch.
That part usually comes shortly after acquisition of said thang and either the firing or making the work place for the previous crew so horribly unbearable to them that they are all replaced by properly indoctrinated replacements who properly reflect the companies core values (or lack of any thereof).

Since for all intents and purposes FB is a data gathering and exploiting company, I am sure it will not take long for them to make this a fine addition to their list of tools for doing such, if they haven't started already (but I believe there were some stories indicating they already had started).

*Edit - as far as lumping people into groups, I try to avoid it as it is counterproductive in almost all cases. All I can do is control my own input/output, so I adjust that, but the rest I take at face value for the most part.
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3803
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Custom keyboard

Post by richmond62 » Thu Nov 07, 2019 11:24 am

My Devawriter Pro uses a custom font with about 5,000 glyphs in the Personal Private Use Area
(Wow: doesn't "Personal Private Use Area" sound like somewhere you go and do unmentionably
private things with your partner(s) of choice: 'kinky b*ggers' those Unicode people, obviously)
that are then "strained" through monster SWITCH statements inwith my program.

To effect the same with specialised keyboard drivers/layouts (and, of course, all
different for every platform) would be a serious uphill struggle that seems hardly
justified.

So, if there were a way that one could send the end results of all those monster SWITCH statements
directly to word-processing apps that would be amazing.

Post Reply

Return to “Using Environment Extensions”