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: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Re: Custom keyboard

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

Well, like I said up there, I think there is a way, but unfortunately have never explored it too much.

The reason I think it must be doable (at least on the desktop) is that all the way back to Mc you could use an external editor apparently using nothing but Lc scripting.

SEVERAL others have taken that and applied it to plugins as well, Ken Ray did it, Trevor did it, Thierry has done something like it but in a different and spectacular reverse IDE way.

My conclusion, it is completely doable, and probably not that difficult, once you know how.
ksnip-editMeExternally.png
Beam me sideways Scotty!
Image

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

Re: Custom keyboard

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

probably not that difficult, once you know how
Aha: so after the snidity (err, is that a real word?), sarcasm and so on you are now indulging in profundity. 8)

Better try and fish out a computer (the iMacs of various vintages are stacked 4 deep on my desk,
like some sort of library) that runs MetaCard in some way that is usable and try to fish out the
underlying code.

Isn't it "funny" how LiveCode, for some reason (cough), have seen fit to drop one or two
seemingly rather useful things that were 'there' in MetaCard and earlier recensions of Revolution/Livecode?

NO: don't answer that one; it is rhetorical. :D

Had a bad week with "plugins" (see the Off-Topic Forum), so really would like to have built-in code.

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

Re: Custom keyboard

Post by bogs » Thu Nov 07, 2019 12:31 pm

You should be able to run Mc easily on any 'nix or win desktop, or with minimum difficulty on mac (can't say for the newest ones which don't run 32 bit though, may have to use the latest Lc install to get that one to fly).
richmond62 wrote:
Thu Nov 07, 2019 11:42 am
Isn't it "funny" how LiveCode, for some reason (cough), have seen fit to drop one or two
seemingly rather useful things that were 'there' in MetaCard and earlier recensions of Revolution/Livecode?

NO: don't answer that one; it is rhetorical. :D
It is ok, I'm a rhetorical kinda guy :P
Reasoning for doing x over y is highly dependent on what is going on at the time. Much as I love working in the Mc IDE, I can see a LOT of why certain choices were made when moving to RR 1 and 2 and later. Some of them I don't understand, but I wasn't around at the time either and so may be missing a lot of back-history behind the decision(s).

I finally did get a copy of 2.8.x going too, which is a kind of "in-between" the original RR IDE and the "new(er)" current layout. I can tell you that for a 1 guy doing it perspective, going through all the stacks is a long process. Noting things that were changed and the reason why is informative as well. A lot of the original code was tied to things that it probably shouldn't have been, discovered, changed, re-hashed, rinse / repeat.

Some of the code is over my head / current level, so I can only guess at what it is doing. I find it somewhat daunting to reach those areas. Some of it was refactored, some of it has redundant looping. Some of it is just plain weird.

Your specialty program just went through a re-write, I'd think of all people you could understand why changes are made (or not) to particular aspects of a program.
Image

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

Re: Custom keyboard

Post by richmond62 » Thu Nov 07, 2019 1:29 pm

with minimum difficulty on mac
With no difficulty whatsoever on my G5 iMac running 10.4.11. :D
Your specialty program just went through a re-write
No it didn't: that's a horribly-long-winded process, and not really a rewrite as such,
just improved modularity.
I'd think of all people you could understand why changes are made (or not) to particular aspects of a program.
Err . . . well . . . I know why I changed from numToChar to numToCodePoint
. .[and that was not really a decision of mine; something forced on me by a change in Livecode: and, to be fair, an extremely
good change] . . and I know why I am refactoring; because bloatware is not "float-my-boat-ware",
but beyond that . . . not really. 8)

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

Re: Custom keyboard

Post by FourthWorld » Thu Nov 07, 2019 4:41 pm

Launching an external editor is a very different task from making custom keyboard to input into other programs.

About the only thing they have in common is that they involve other programs.

An external editor is a completely separate action, in which (as implemented in MC) is entirely modal, freezing local execution until the editor is exited. This is very with-the-grain in terms of linking stdin and stdout in Unix pipelines.

A keyboard requires both process's event loops to be running, and to maintain full duplex communication between them, complicated by the nuances of GUI text editing (such as knowing within LC when a user clicks outside an input field in the other program). Deep, heavy stuff.

Personally, given the complexity involved, I wouldn't attempt making a custom keyboard for use in other apps using anything other than the OS-prescribed APIs for that. And even then I'd have to think twice about it, because I'd be writing different LCB code for every platform I'd want to support, since all their APIs are different.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Custom keyboard

Post by richmond62 » Thu Nov 07, 2019 10:16 pm

I wouldn't attempt making a custom keyboard for use in other apps
well, if you wouldn't I certainly wouldn't: too many kids to stuff with English to even begin
the cognitive effort before an attempt. 8)

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

Re: Custom keyboard

Post by bogs » Fri Nov 08, 2019 12:26 am

Did not realize that Richard, but I probably should have arrived at the same point. Lets see if I now have the chain of events down...
1. call the external editor
2. suspend the dev environment
3. save the script from the external editor
4. voodoo applying the saved file to the script of the object you were writing for
5. ? profit ??

Although, I don't think the project Thierry was working on works on that principle, but I will leave that for him to reveal (or not).

I still think it should be possible to do the virtual keyboard thing probably using only Lc, if I get a chance I'll look into it this weekend, but no promises.
Image

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

Re: Custom keyboard

Post by FourthWorld » Fri Nov 08, 2019 2:04 am

bogs wrote:
Fri Nov 08, 2019 12:26 am
Did not realize that Richard, but I probably should have arrived at the same point. Lets see if I now have the chain of events down...
1. call the external editor
2. suspend the dev environment
3. save the script from the external editor
4. voodoo applying the saved file to the script of the object you were writing for
5. ? profit ??

Although, I don't think the project Thierry was working on works on that principle, but I will leave that for him to reveal (or not).
Probably not, nor Trevor's. Moving beyond the old modal way MC used into something more fluid is a bit of work, but necessary for modern expectations, which is why LC didn't bother putting the old MC method into their IDE.
I still think it should be possible to do the virtual keyboard thing probably using only Lc, if I get a chance I'll look into it this weekend, but no promises.
Probably not on mobile, which seems to be what the OP is looking for. But if you can do it for desktop it might make a good learning tool.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Custom keyboard

Post by bogs » Fri Nov 08, 2019 2:09 am

I'd have no way to test for mobile anything heh, but I do think it is interesting enough a problem to test out on the rig.
Image

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

Re: Custom keyboard

Post by richmond62 » Fri Nov 08, 2019 7:11 am

My personal fantasy consists of being able to select a text-editor from within a stack,
and subsequent to that ALL keyDown and keyUp signals would be trapped by
BOTH the stack and the text-editor.

OR, that a selected subset of keyDown and keyUp signals would be sent to the text-editor,
while ALL would be trapped by the stack.

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Custom keyboard

Post by Thierry » Fri Nov 08, 2019 8:17 am

bogs wrote: Although,
I don't think the project Thierry was working on works on that principle
Hi Sir,

You're right; it's a different thinking.
Actually quite the opposite of old technics.
The main idea is to have a tiny "script oriented IDE" - not sure if it's the best English definition :)
because that's where I spend most of my time (scripting).

I had already made such a tool more than 10 years ago with komodo for one of my customer.
Today I'm doing it with BBEdit.

Otherwise not *was* but *is* , and I'm using it for my work, right now.

Code: Select all

, but I will leave that for him to reveal (or not).
Ok, I will reveal it in its due time for your pleasure :)

I'll add a page on my site to explain the core concept
followed by screenshots to see it in action.
About sharing this tool,
it will take some time mainly because of few followers
plus being active on projects which put some food in my plate...


Enjoy your day,

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

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

Re: Custom keyboard

Post by bogs » Fri Nov 08, 2019 12:07 pm

Thierry wrote:
Fri Nov 08, 2019 8:17 am
Otherwise not *was* but *is* , and I'm using it for my work, right now.
That is great to hear! But this was even better -
being active on projects which put some food in my plate...
:D :D

Look forward to the big reveal my friend :)
Image

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Custom keyboard

Post by Thierry » Fri Nov 08, 2019 12:21 pm

bogs wrote:
being active on projects which put some food in my plate...
:D :D
Look forward to the big reveal my friend :)
I'm training my cat for debugging before anything else....


Capture d’écran 2019-11-08 à 09.00.37.png
Capture d’écran 2019-11-08 à 09.00.37.png (120.85 KiB) Viewed 13717 times

Be well :)

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

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

Re: Custom keyboard

Post by bogs » Fri Nov 08, 2019 9:43 pm

Whoa, for a second, I thought you had found a picture of OUR cat :shock:
Image

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Custom keyboard

Post by [-hh] » Fri Nov 08, 2019 9:50 pm

The cat obviously admires a photo of a desktop machine with an attached mouse.
shiftLock happens

Post Reply

Return to “Using Plugins for Customizing the LiveCode IDE”