Page 1 of 1

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

Posted: Mon Nov 29, 2021 3:24 am
by Tarq

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


Re: Switch between two languages in the keyboard

Posted: Mon Nov 29, 2021 8:00 pm
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


Re: Switch between two languages in the keyboard

Posted: Thu Dec 02, 2021 12:40 pm
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

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

Posted: Thu Dec 02, 2021 5:50 pm
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.


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

Posted: Thu Dec 02, 2021 5:57 pm
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
#

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

Posted: Sat Dec 04, 2021 7:24 am
by Tarq

How do I copy and print commands from the command line


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

Posted: Sat Dec 04, 2021 7:28 am
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


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

Posted: Sat Dec 04, 2021 11:14 pm
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?


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

Posted: Sun Dec 05, 2021 1:17 am
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"


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

Posted: Sun Dec 05, 2021 6:55 am
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'.

Собака


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

Posted: Sun Dec 05, 2021 11:25 pm
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


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

Posted: Sun Dec 05, 2021 11:52 pm
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.