Ali*_*a41 9 keyboard keyboard-layout
我在 Ubuntu 系统上使用英语和波斯语键盘布局。我想用Left Alt+Left Shift和Right Alt+更改键盘布局Right Shift。目前我无法使用Right Alt+Right Shift将键盘布局从波斯语更改为英语,因此我必须使用Left Alt+Left Shift来更改它。
有谁知道我如何设置Alt+Shift来改变两边的键盘布局?我使用 ubuntu 12.04。
谢谢!
好的,再试一次,我希望这个能成功……;)
积分归功于reverendj1,他描述了一种使用setxkbmap分配自定义键以切换键盘布局的方法,该方法在我之前回答的Edit 2中提到的解决方法中具有特色...
这是稍微复杂的方式,但会给您更多的组合键灵活性。首先,复制并粘贴我编写的这个脚本并将其命名为 kb_toggle.sh。确保将 LANG1 和 LANG2 编辑为您需要的键盘布局代码。
Run Code Online (Sandbox Code Playgroud)#!/bin/bash LANG1="us" LANG2="de" CURRENT_LANG=$(setxkbmap -query | tail -n 1 | cut -f6 -d ' ') if [ "$CURRENT_LANG" = $LANG1 ]; then setxkbmap $LANG2 else setxkbmap $LANG1 fi通过右键单击该文件 ->“属性”->“权限”选项卡,然后选择“允许将文件作为程序执行。
现在,打开“系统设置”->“键盘”->“快捷方式”选项卡并选择“自定义快捷方式”。单击底部的 + 按钮并将快捷方式命名为“键盘切换”或您想要的任何名称,真的。然后提供您之前在命令框中创建的脚本的完整路径。点击应用。单击显示“已禁用”的位置,然后您可以通过单击组合键将快捷方式设置为您想要的任何内容!
我认为您需要更改"de"为"ir".
再次祝你好运!
编辑
如果您愿意,您甚至可以使用one-liner:
Run Code Online (Sandbox Code Playgroud)setxkbmap us,ir -option "grp:alt_shift_toggle"现在你可以通过按 alt+shift 切换
另见http://wiki.lxde.org/en/Change_keyboard_layouts和http://www.x.org/releases/X11R7.7/doc/man/man1/setxkbmap.1.xhtml
编辑 2
根据如何你决定要实现你的目标,你可能要包括lv3:ralt_alt在您的命令,导致
setxkbmap us,ir -option "lv3:ralt_alt,grp:alt_shift_toggle"
Run Code Online (Sandbox Code Playgroud)
详情请参阅man xkeyboard-config | grep lv3:
lv3:ralt_alt
右键 Alt 键永远不会选择第 3 级
Run Code Online (Sandbox Code Playgroud)xkeyboard-config provides the description files for the X Keyboard Extension (XKB). The configuration options below are usually applied with setxkbmap(1).
| 归档时间: |
|
| 查看次数: |
15554 次 |
| 最近记录: |