국제 키보드, 그리스어 및 유니 코드 수학을위한 사용자 정의 키보드 레이아웃을 빠르게 만들 수있는 도구가 있습니까?


23

맞춤 키보드 레이아웃을 빠르게 만들 수있는 도구가 있습니까?

예 : https://tex.stackexchange.com/a/86559/1871

keyboard

2 차 계층에서 유니 코드 문자를 생성하지만 미국 국제 (Alt GR-dead 키)을 기반으로합니다

이것은 주로 유니 코드를 사용하여 수학을 입력하는 것이지만 기본 레이어를 미국 국제로 유지합니다.

아마도 일반적인 것이 준비되어 있다면 설치하는 방법이 있습니까?

이 질문은 특정 응용 프로그램에서 바로 가기를 생성하는 것이 아니라 시스템의 키보드 레이아웃을 변경하는 것입니다.

15

I think this tool might work for you although I've never used it. keyboardlayouteditor

If it doesn't work then with a little patience you can create a custom keyboard layout by yourself.

I know it's not a quick way to do it but by doing it this way you will learn something.

If you decide to do it by yourself then the only thing you need to do is edit a file located in /usr/share/x11/xkb/symbols.

Inside the folder "symbols" you will find all the keyboard layout files.

Backup the file you want to use, in your case the "us" file.

To backup the file open a terminal and type:

cp /usr/share/X11/xkb/symbols/us /usr/share/X11/xkb/symbols/us_backup

Now open the "us" file:

sudo gedit /usr/share/X11/xkb/symbols/us

You will see something like this:

// Alphanumeric section
key <TLDE> {    [     grave,    asciitilde  ]   };
key <AE01> {    [     1,    exclam      ]   };
key <AE02> {    [     2,    at      ]   };
key <AE03> {    [     3,    numbersign  ]   };
key <AE04> {    [     4,    dollar      ]   };
key <AE05> {    [     5,    percent     ]   };
key <AE06> {    [     6,    asciicircum ]   };
key <AE07> {    [     7,    ampersand   ]   };
key <AE08> {    [     8,    asterisk    ]   };
key <AE09> {    [     9,    parenleft   ]   };
key <AE10> {    [     0,    parenright  ]   };
key <AE11> {    [     minus,    underscore  ]   };
key <AE12> {    [     equal,    plus        ]   };

The key <xxxx> entries are the name of the keys and the {[]}; entries are the symbols

The image below will show you the key codes:

enter image description here

Now to create your custom keyboard layout you need to replace the contents of {[]}; with the symbol names you want.

For example in order to replace the exclamation mark with the dollar symbol change the following line

key <AE01> {    [     1,    exclam      ]   };

to this:

key <AE01> {    [     1,    dollar      ]   };

After you finish editing your custom keyboard save the file and restart your computer.

In case you want to go back to your original "us" keyboard layout open a terminal and type the following:

sudo cp /usr/share/X11/xkb/symbols/us_backup /usr/share/X11/xkb/symbols/us

For further reading:


0

This is not an answer to my own question but a very useful alternative that consists in configuring gedit for the purpose of typing unicode/special characters.

After trying some of the proposed solutions, I realized that changing the keyboard layout is an overkill. After all, I needed it only to code (mainly "string"s with unicode and math in LaTeX). So I decided that for my purpose it was better to somehow make my editor able to convert writen words into unicode characters.

My editor is gedit, which has a standard plugin called Snippets. I realized that if I put the special characters in ~/.config/gedit/snippets/global.xml I would be able to type them in any text file.

I made a program that reads a table of unicode characters and a their common names and builds the snippets file. In this way I type the name of character, like _alpha and press TAB and α appears. There are no key combiations or keyboard layers to remember.

After the process my ~/.config/gedit/snippets/global.xml file looks like this. Don't forget to activate the Snippet plugin.

<?xml version='1.0' encoding='utf-8'?>
<snippets>
  <snippet>
    <description>New snippet</description>
  </snippet>
  <snippet>
    <text><![CDATA[α]]></text>
    <tag>_alpha</tag>
    <description>alpha</description>
  </snippet>
  <snippet>
    <text><![CDATA[β]]></text>
    <tag>_beta</tag>
    <description>beta</description>
  </snippet>
  <snippet>
    <text><![CDATA[χ]]></text>
    <tag>_chi</tag>
    <description>chi</description>
  </snippet>
  <snippet>
    <text><![CDATA[ⅆ]]></text>
    <tag>_dd</tag>
    <description>dd</description>
  </snippet>
  <snippet>
    <text><![CDATA[γ]]></text>
    <tag>_gamma</tag>
    <description>gamma</description>
  </snippet>
  <snippet>
    <text><![CDATA[ℏ]]></text>
    <tag>_hbar</tag>
    <description>hbar</description>
  </snippet>
  <snippet>
    <text><![CDATA[μ]]></text>
    <tag>_mu</tag>
    <description>mu</description>
  </snippet>
  <snippet>
    <text><![CDATA[ω]]></text>
    <tag>_omega</tag>
    <description>omega</description>
  </snippet>
  <snippet>
    <text><![CDATA[Ω]]></text>
    <tag>_Omega</tag>
    <description>Omega</description>
  </snippet>
  <snippet>
    <text><![CDATA[π]]></text>
    <tag>_pi</tag>
    <description>pi</description>
  </snippet>
  <snippet>
    <text><![CDATA[ε]]></text>
    <tag>_varepsilon</tag>
    <description>varepsilon</description>
  </snippet>
  <snippet>
    <text><![CDATA[𝟷]]></text>
    <tag>_1</tag>
    <description>1</description>
  </snippet>
</snippets>

Notes:

  1. The idea is taken from here http://ubuntuforums.org/showthread.php?t=1892012 , with the addition that I wrote a program to massively generate the file from a table.
  2. Why the underscore (e.g. _pi)? This is because otherwise many snippets will conflict with the autocompletion feature. For example pi+TAB will not produce π but it will produce picture if this word is mentioned in the document.
  3. Additional characters can be added manually by copying and pasting from the Gnome Character Map program.
  4. To activate the Snippets plugin, first install the gedit plugins package. Then go to Preferences->Plugin->click on Snippets. Then, from the Tools->Manage Snippets... menu, verify that the entries are avialable in the Global group (at the top).

2

Recently looking at packages I found mathwriter input.

This, apparently in Gnome3, allows the input of mathematical characters as if it were a special language. This allows to enter symbols by typing the name of the symbol, in the screen a menu appears with options and hitting space allow to choose a match.

Relevant links:

https://launchpad.net/ubuntu/+source/ibus-table-others/1.3.5-2

https://github.com/mike-fabian/ibus-table-others

https://code.google.com/p/ibus/

mathwriter