Thanks, Richard.

That seems like a step in the right direction.
In the LyX functions user guide I indeed read about command sequences.
One interesting point is that you can toggle between languages using the
language lfun,
with no arguments.
However, I still cannot find a way for a single shortcut to do exactly
what I want.
That is because LyX does not capture shortcuts used for system keyboard
layout toggle.
So, it's not possible to set a shortcut of Alt + Shift -> language toggle.
I would not mind having to use another shortcut, as long as it's only 1,
to have the appropriate results.
For example, something like that would require an lfun sequence like:
<layout toggle> ; <language toggle>.
I still cannot achieve the layout toggle.
I checked out keyboard mappings a bit, but to no avail.

Another thing that caught my eye is that you can control LyX from other
programs using lfuns.
So, I though as a last resort solution to write a bash script that
senses the layout toggle and sends
the appropriate lfun to LyX. However, in the lfuns manual, I only found
a small reference to that feature
at the beginning. Is there any detailed documentation about this?


On 08/18/2015 11:21 PM, Richard Heck wrote:
On 08/18/2015 12:39 PM, alex wrote:
Hello everyone.

I have been using LyX as my LaTeX editor of choice for quite some
time now, and I have found it to be quite helpful. I have also
managed to set up spell checking for both the languages that I am
interested in, English and Greek. However, the way that I currently
toggle between those languages is quite inconvenient. That is, I use
Alt + Shift to toggle between languages (as I usually do), which
achieves the transition from one language to another. However, that's
not enough to get LyX to toggle to the latter language. LyX keeps
spell-checking using the former language. I have to use a second
keyboard shortcut to get LyX to switch languages, as far as
spell-checking goes. For example, I have to use 2 keyboard shortcuts
in order to go from writing English characters with English
spell-checking to writing Greek characters with Greek spell-checking,
and vice versa. Obviously, those are one too many shortcuts.

So, my question is: can LyX be configured so that toggling between
languages is made by one keyboard shortcut, or maybe so that LyX
senses the keyboard layout (GR or US) in use and spell-checks

A single shortcut can do more than one thing, if you use the
command-sequence LFUN. E.g., Ctrl-Alt-A is bound to:
    command-sequence buffer-begin ; buffer-end-select
which has the effect of selecting the whole buffer.

See the documentation for command-sequence under Help> LyX Functions.


Reply via email to