Keyboard synching

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

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

Keyboard synching

Post by richmond62 » Sat Jun 25, 2022 7:17 am

I am bringing this topic up because it got buried as an OT thing in another thread.

Prior to RR/LC 4.5.1 when an end-user moused over a field the keyboard layout
(on Macintosh and Windows) would synch to the keyboard layout that the
designer of the stack had used when entering text into that field.

LiveCode subsequently removed that capability completely.

I should like to know if there is a way to restore that capability from inwith LiveCode
on either a per stack or a per field basis.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Keyboard synching

Post by dunbarx » Sat Jun 25, 2022 2:48 pm

Richmond.
that the designer of the stack had used when entering text into that field.
Are you saying there once was a LC property that held the type of keyboard used by the machine? And that property was later deprecated?

I am not even sure what that means. On a laptop, there is only the built-in keyboard, no? On a desktop machine, you have the option to use any keyboard you want, and that is selected and stored by the OS. It has nothing to do with entering data inWith LC.

I could be wrong about this.

Craig

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

Re: Keyboard synching

Post by richmond62 » Sat Jun 25, 2022 5:01 pm

Are you saying there once was a LC property that held the type of keyboard used by the machine? And that property was later deprecated?
Something of that sort:

https://downloads.livecode.com/livecode ... -4_5_1.pdf
-
SShot 2022-06-25 at 18.59.15.png
-
I have a theory that as LiveCode has gone hell-for-leather for what are perceived as 'modern features' it has lost
some useful things as well.

Now, as LiveCode is largely written in itself it might be possible to work out if there is some LiveCode that could
be used to turn Keyboard synching on and off as required.

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

Re: Keyboard synching

Post by FourthWorld » Sat Jun 25, 2022 6:23 pm

richmond62 wrote:
Sat Jun 25, 2022 5:01 pm
Are you saying there once was a LC property that held the type of keyboard used by the machine? And that property was later deprecated?
Something of that sort:

https://downloads.livecode.com/livecode ... -4_5_1.pdf
-
SShot 2022-06-25 at 18.59.15.png
-
I tried a quick search to learn what "keyboard syncing" is, but only found discussions of transceiver pairing.

Do you know of a link to some resource that explains it more thoroughly than the v4 Release Notes?
I have a theory that as LiveCode has gone hell-for-leather for what are perceived as 'modern features' it has lost
some useful things as well.
If it's not how things are done, there may be a good reason for it.

How does the rest of the world handle this?
Now, as LiveCode is largely written in itself it might be possible to work out if there is some LiveCode that could
be used to turn Keyboard synching on and off as required.
That item is listed under "Engine Changes". Working on the engine requires strong competence with C++, and is no longer possible for outsiders anyway because at the point the engine source is exclusively proprietary. All changes to the engine require payroll burn for the company.
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: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Keyboard synching

Post by richmond62 » Sat Jun 25, 2022 7:42 pm

I could not find any other documentation.

But I did mess around with a field in RevMedia 4 running on MacOS 10.7 that contained the word Ябълка (Bulgarian for 'apple')
and setting the keyboard layout to US I then dragged my mouse into the field, at which point the keyboard layout icon
changed to the Bulgarian one.

Opening the same stack in LiveCode 8.1.10 and doing the same thing resulted in the keyboard layout icon NOT changing.

I believe restoring Keyboard synching as an option would be very useful.

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

Re: Keyboard synching

Post by richmond62 » Sun Jun 26, 2022 7:28 am

Certainly would be good for language teaching programs; one field, say, set to Vietnamese, and one set to Kazakh.

So, when learners have to type in a field in a specific language they don't have to fossick around setting keyboard layouts (especially as systems often offer a plethora of competing layouts for one language).

Nothing like a bit of pseudocode on a Sunday morning:

on mouseEnter
set the keyBoard to "Batavian"
end mouseEnter

stam
Posts: 2635
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Keyboard synching

Post by stam » Sun Jun 26, 2022 2:10 pm

dunbarx wrote:
Sat Jun 25, 2022 2:48 pm
On a laptop, there is only the built-in keyboard, no? On a desktop machine, you have the option to use any keyboard you want, and that is selected and stored by the OS. It has nothing to do with entering data inWith LC.

I could be wrong about this.

Craig
Wrong way round.
The 'keyboard' is a software construct at OS level that maps a correlation between keys and glyphs - you just usually choose to have the correct mapping for the hardware keyboard you have, but you can map any keyboard to the physical keyboard you have.

For example, I frequently will use my UK English keyboard to type Greek and sometimes Swedish - it's just a software remap at OS level.

But that is at OS level and would require either LC to have built in hooks to the various OS's or an LCB library i imagine...

stam
Posts: 2635
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Keyboard synching

Post by stam » Sun Jun 26, 2022 2:23 pm

richmond62 wrote:
Sat Jun 25, 2022 7:42 pm
I could not find any other documentation.

But I did mess around with a field in RevMedia 4 running on MacOS 10.7 that contained the word Ябълка (Bulgarian for 'apple')
and setting the keyboard layout to US I then dragged my mouse into the field, at which point the keyboard layout icon
changed to the Bulgarian one.

Opening the same stack in LiveCode 8.1.10 and doing the same thing resulted in the keyboard layout icon NOT changing.

I believe restoring Keyboard synching as an option would be very useful.
OK, against my better judgement, I'll bite.

Are you saying that if some text produced by a keyboard map that is different from the system setting is in a field, that LC would automatically change the system setting to the keyboard of that language?

Presumably that text would have been copy/pasted into the field (or imported through other means) as if it was produced by typing, the keyboard would surely already in the desired language.

What would really be the value of changing the system keyboard in this context?
Do you really want to change the keyboard to a language not reflected by the hardware keyboard just because a field happened to contain a 'foreign' (to the system keyboard) language?

And how would you cater for text that contain more than one language? I personally will write some text in Greek, but will occasionally put English words in because there is no equivalent in Greek and spelling it out phonetically in Greek is rather crass. But my keyboard is UK English and most of the stuff type is in English. I really don't want he keyboard automatically deciding to switch languages on me.

You do realise it's just a keyboard combo to switch keyboards (on my mac it's ctrl-alt-space). Why such fixation on automated switching?
I just can't see any value in what you're proposing in multiple posts...

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Keyboard synching

Post by dunbarx » Sun Jun 26, 2022 2:37 pm

Stam.

I wrote my post poorly. Richmond had originally said
an end-user moused over a field the keyboard layout
(on Macintosh and Windows) would synch to the keyboard layout that the
designer of the stack had used when entering text into that field.
I really was wondering about, if for example there were two fields on a card, that hovering over a field would change the keyboard somehow "assigned" to that field. In other words, as I see it, LC once had a field property that stored a certain keyboard, and was automatically changed on, I assume, "mouseWithin" or perhaps "mouseEnter".

What was the name of that property?

Craig

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

Re: Keyboard synching

Post by richmond62 » Sun Jun 26, 2022 4:28 pm

I really was wondering about
That certainly happens with a stack containing 2 field in RevMedia 4: one in Bulgarian (i,e using a Bulgarian keyboard
layout on mac OS 10.7.5) and one in Sanskrit (using a Devanagari keyboard layout).
-
Screen Shot 2022-06-26 at 6.26.35 PM.png
-
Anyone who has a way of running RR/LC 4.5.0 or lower (Mac or Windows) should give it a try: seeing is believing.

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

Re: Keyboard synching

Post by richmond62 » Sun Jun 26, 2022 4:32 pm

Why such fixation on automated switching?
Because an awful lot of end-users may not know how to do things like that,
so it would be great if a standalone could do that for them.
multiple posts...
2 threads . . .

I f you find this annoying go and read something else, as you obviously don't feel you're going to miss much. 8)

While I, on the other hand, feel I'm missing something useful. :shock:
Last edited by richmond62 on Sun Jun 26, 2022 4:34 pm, edited 1 time in total.

stam
Posts: 2635
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Keyboard synching

Post by stam » Sun Jun 26, 2022 4:34 pm

dunbarx wrote:
Sun Jun 26, 2022 2:37 pm
Stam.

I wrote my post poorly. Richmond had originally said
an end-user moused over a field the keyboard layout
(on Macintosh and Windows) would synch to the keyboard layout that the
designer of the stack had used when entering text into that field.
I really was wondering about, if for example there were two fields on a card, that hovering over a field would change the keyboard somehow "assigned" to that field. In other words, as I see it, LC once had a field property that stored a certain keyboard, and was automatically changed on, I assume, "mouseWithin" or perhaps "mouseEnter".

What was the name of that property?

Craig
I see - not quite what i understood then... thanks for clarifying.

I'm still not sure if
a) this should be called "keyboard synching" as that is confusing - what you mean is that on entering the field a preset keyboard should be assigned (rather than 'synced' to the text) if i understood correctly. This would have to be an OS call and if not already implemented in LC, perhaps some talented LCB dev could create a library for this. But i'm not sure this is or even should be a property of the field...

b) not sure what actual use-cases there may be for this - yes i can see how a specific app may utilise this (a very specific use-case maybe), but for most devs this is pointless. Or maybe i'm wrong and there a many use-cases for this, perhaps others can provide concrete examples where an app would needs 2 or more keyboard mappings assigned by the app (rather than the user)...

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

Re: Keyboard synching

Post by richmond62 » Sun Jun 26, 2022 4:43 pm

Use-case from the Richmond fantasy factory:

A program to teach people Sanskrit, and, more specifically, Sanskrit written using the Devanagari script.

2 fields:

1. Expecting a word in the end-user's native language (e.g. English).

2. Expecting a word in Sanskrit in Devanagari script.

Chummy, without keyboard synching (that's what LiveCode call it in their documentation), will spend
an awful lot of time messing around with keyboard layout settings, which will detract from the learning process.

A couple of years ago, in a fit of stupidity, I offered to teach the basics of LiveCode to the members of staff
of a Linguistics faculty.

Why stupid?

Because I had overlooked the fact that these, undoubtedly very clever, trained and experienced Linguists
were no better at mucking around with the WIMP GUI present on Mac, Windows or Ubuntu than the old lady (pushing 85)
who stays next door to us and uses her machine for knitting patterns.

So, I spent the better half of 3 weeks getting these lecturers up to the sort of level I had, goofily,
expected them to be PRIOR to engaging in any programming classes.

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

Re: Keyboard synching

Post by SparkOut » Sun Jun 26, 2022 5:16 pm

I can't say that it is current or pressing, but... waaaaay back when I worked for a project freight company shipping materials for gasfield and pipeline construction in Kazakstan, we had shipping documents that needed to be completed in both English and Russian. The translators worked on UK keyboards with UK defaults - also remote workers using Cyrillic keyboards and connecting to RDP sessions, which then hijacked the session profile into English layouts. The document forms needed to be worked on with text side by side (or each field one above the other, as it happened).
There was some jiggery-pokery to make this happen in pretty much the way Richmond describes, not that there was anything to do with LiveCode in this situation (or even RunRev or Runtime Revolution or...) but the translators could type something in English in one field and Russian in the next field without changing any settings in the O/S.
Building an app with fields on which you can set keyboard mappings in the same way you can set a font* does have a use-case. I can't say that it is likely to get any attention in LiveCode though.
This was *never* an option on Linux, whatever the version.

*this was actually how it was done. The field font was set to a home-made cyrillic typeface which was created by copy/pasting cyrillic glyphs into the mapping for the English letters on the keyboard which corresponded to the equivalent they would have been in a Cyrillic keyboard layout.

stam
Posts: 2635
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Keyboard synching

Post by stam » Sun Jun 26, 2022 6:13 pm

Ok I can see how there there are some rare uses cases - but again this will be low priority for LC. Perhaps some enterprising dev handy with LCB could do a cross platform library for the system calls to do this.
Or if it’s only for macOS you can probably do this with AppleScript.

However, 1 point Richmond: if your users have so much difficulty switching keyboards, how will they fare using these keyboards?

I mean if you have a Bulgarian keyboard that is remapped to Sanskrit, do you think your users will fare well guessing which keys are mapped to each glyph??

As mentioned I frequently type Greek texts with my UK English keyboard and even after several years of doing this I still encounter difficulties remembering which English keys map to each Greek letter, and some thing I still haven’t figured out (like how to add intonation marks).

Much easier on iOS of course as the actual keyboard changes and has a much better autocorrect… but I would dread supporting users through using two different keyboard layouts on the same physical keyboard if they can’t achieve the simple task of switching keyboards…

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”