DEV Community

Cong
Cong

Posted on • Edited on

4

Ubuntu で日本語キーボード

Ubuntu 18.04 では比較的簡単に日本語入力の設定ができるのだが、キーボードレイアウトがUSのままだと、全角半角ボタンでIMEオンオフができなかったり、@ の場所が違ったりして使いづらいため、キーボードのレイアウトを日本語にしたい。

コンソールで使うキーボードの設定

sudo dpkg-reconfigure keyboard-configuration
Enter fullscreen mode Exit fullscreen mode

Generic 105-key PC (intl.)JapaneseJapaneseThe default for the keyboard layoutNo compose keyYes と入力する。

X(GUI)で使うキーボードの設定

gnome-session-properties
Enter fullscreen mode Exit fullscreen mode

Addsetxkbmap -layout jpSave
ちなみに、Caps LockキーをCtrlとして使いたければ

setxkbmap -layout jp -option ctrl:nocaps
Enter fullscreen mode Exit fullscreen mode

Screenshot from 2019-03-27 12-06-49.png

なお Ctr-Alt-F3 でコンソールへ一時的に切り替えて、
また Ctr-Alt-F2 でX GUIに戻ると、キーボードレイアウトが
USになるバグがあるので、ターミナルに

 setxkbmap -layout jp
Enter fullscreen mode Exit fullscreen mode

で解決。

キーボードレイアウトの確認

$ setxkbmap -print -verbose 10 | grep layout
layout:     jp
Enter fullscreen mode Exit fullscreen mode

Ubuntuの設定ツールで見ると
Japanese Keyboard layout

Image of Datadog

Master Mobile Monitoring for iOS Apps

Monitor your app’s health with real-time insights into crash-free rates, start times, and more. Optimize performance and prevent user churn by addressing critical issues like app hangs, and ANRs. Learn how to keep your iOS app running smoothly across all devices by downloading this eBook.

Get The eBook

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay