How to switch between two languages in the keyboard with 2 buttons?

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
Tarq
Posts: 26
Joined: Tue Nov 23, 2021 7:07 am
Has thanked: 1 time

How to switch between two languages in the keyboard with 2 buttons?

Post by Tarq »

Switch from keyboard between how languages
I want to set two buttons to do that

Last edited by Flash on Mon Nov 29, 2021 10:15 pm, edited 1 time in total.
Reason: Original title: Switch between two languages in the keyboard
williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: Switch between two languages in the keyboard

Post by williams2 »

You can use the Mouse-Keyboard Wizard in the menu.

Or you can type setxkbmap 'us,ara' -option grp:lctrl_lshift_toggle in a terminal (console)

Then you can switch between us and ara by pressing the left control and shift keys.

You can choose other keymaps, of course, and you can choose other grp keys.

You can put the setxkbmap command in a script if you want it to execute automatically when Puppy boots.
Like this:

Code: Select all

#!/bin/sh
sleep 5
setxkbmap 'us,ara' -option grp:lctrl_lshift_toggle

Put the script in /root/Startup/

Or you can edit the file /etc/X11/xorg.conf

Tarq
Posts: 26
Joined: Tue Nov 23, 2021 7:07 am
Has thanked: 1 time

Re: Switch between two languages in the keyboard

Post by Tarq »

williams2 wrote: Mon Nov 29, 2021 8:00 pm

Or you can type setxkbmap 'us,ara' -option grp:lctrl_lshift_toggle in a terminal (console)

I want it on the right side
Tried this and it didn't work

Code: Select all

root# setxkbmap 'ar,us' -option grp:ralt_rshift_toggle
User avatar
mikeslr
Posts: 2762
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 170 times
Been thanked: 826 times

Re: How to switch between two languages in the keyboard with 2 buttons?

Post by mikeslr »

Just an idea if you have enough RAM. Both LibreOffice and OpenOffice will run under Puppys. Both offer Arabic language packs. They will run and open the same datafile simultaneously. Puppy's Taskbar can provide multiple Virtual Windows. It only takes ONE CLICK to switch between them.

williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: How to switch between two languages in the keyboard with 2 buttons?

Post by williams2 »

i do not think ralt will work, because it is a special key (compose key?)

This will toggle the keymaps if you press and release just the right alt key:

setxkbmap 'ar,us' -option grp:toggle

Or this (rctrl and rshift) will work: setxkbmap 'ar,us' -option grp:rctrl_rshift_toggle

More information in /etc/X11/xkb/rules/base.lst

Code: Select all

# setxkbmap 'ar,us' -option grp:toggle
#
# echo ضصثقف qwerty
ضصثقف qwerty
#
Tarq
Posts: 26
Joined: Tue Nov 23, 2021 7:07 am
Has thanked: 1 time

Re: How to switch between two languages in the keyboard with 2 buttons?

Post by Tarq »

How do I copy and print commands from the command line

Tarq
Posts: 26
Joined: Tue Nov 23, 2021 7:07 am
Has thanked: 1 time

Re: How to switch between two languages in the keyboard with 2 buttons?

Post by Tarq »

williams2 wrote: Thu Dec 02, 2021 5:57 pm

i do not think ralt will work, because it is a special key (compose key?)

This will toggle the keymaps if you press and release just the right alt key:

setxkbmap 'ar,us' -option grp:toggle

Or this (rctrl and rshift) will work: setxkbmap 'ar,us' -option grp:rctrl_rshift_toggle

More information in /etc/X11/xkb/rules/base.lst

Code: Select all

# setxkbmap 'ar,us' -option grp:toggle
#
# echo ضصثقف qwerty
ضصثقف qwerty
#

I'm used to Shift + Alt on the right
I'm used to it how do I do it

williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: How to switch between two languages in the keyboard with 2 buttons?

Post by williams2 »

how do I do it

AFAIK, from reading /etc/X11/xkb/rules/base.lst
setxkbmap (Xorg) does not seem to support ralt+rshift

setxkbmap does seem to support only the right alt key. You can also press the right shift key if you want.
So ralt should work
and ralt+rshift should work
if you do this: setxkbmap 'ar,us' -option grp:toggle

I'm used to it

What operating system are you using that allows ralt+rshift?

williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: How to switch between two languages in the keyboard with 2 buttons?

Post by williams2 »

This does work, but the compose key, right alt (ALTgr) may not work to shift to level 3.

setxkbmap ar,us -option "lv3:ralt_alt,grp:alt_shift_toggle"

User avatar
cobaka
Posts: 519
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 87 times
Been thanked: 49 times

Re: How to switch between two languages in the keyboard with 2 buttons?

Post by cobaka »

@Tarq
I hope I understand the question.
I believe you want configure your kdb so that there are two fonts available; to toggle between the two fonts you simultaneously press two keys.

On my copy of uPupBB32 I regularly use a Cyrillic font or an English font with the Geany editor.
I switch by pressing/holding "alt" + then "left-shift". Then I release both keys. I alternately get the Cyrillic <-> English font.

This is not configured as standard in Puppy Linux; but it is (moderately) easy to do.
On the desktop find Puppy Setup. In uPupBB this is 3 icons left from the shutdown (red) button).

Then, click "mouse/keyboard". Then "advance configuration".
You select keyboard type first. Match the keyboard you have with one on the list. (101 key kbd, 104 key kbd, The all-singing-all dancing Microsoft beats all kbd, The "Microsoft for arthritis" kbd, and so on ...)

After that set 'layout' and after that 'variant'. For example, you can chose a standard Russian kbd or a phonetic keyboard, (where F -> Ф, or P -> П and so on). You can set the switch to turn on a kbd LED, so you know (at a glance) which font is active.

After a little experimentation - you'll get exactly what you want.
I hope my explanation answers the Q I didn't understand.

All the best and 'woof'.

Собака

собака --> это Русский --> an old dog
"so-baka" (not "co", as in coast or crib).

Tarq
Posts: 26
Joined: Tue Nov 23, 2021 7:07 am
Has thanked: 1 time

Re: How to switch between two languages in the keyboard with 2 buttons?

Post by Tarq »

williams2 wrote: Sat Dec 04, 2021 11:14 pm

So ralt should work
and ralt+rshift should work
if you do this: setxkbmap 'ar,us' -option grp:toggle

Already worked done
I want to apply the same to the left and right sides of the keyboard

williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: How to switch between two languages in the keyboard with 2 buttons?

Post by williams2 »

I want to apply the same to the left and right sides of the keyboard

Do you mean like this?

setxkbmap ar,us -option grp:toggle,grp:alt_shift_toggle

This will change the keymap if you press:
only the right alt (altgr) key
or either alt key and either shift key

If you use the altgr key for other characters,
it might not work properly.
But, it might work properly.

Post Reply

Return to “Beginners Help”