---
title: "Ubuntu环境下Intellij Idea中键盘失效"
author: "usench"
date: "2016-08-26T10:07:29Z"
tags: []
categories: ["开源软件"]
slug: "ubuntu-intellij-idea"
draft: false
lastmod: "2016-08-26T10:09:30Z"
id: 2320295
url: "https://usench.iteye.com/blog/2320295"
---

http://blog.csdn.net/dslztx/article/details/46700165

 

 

问题描述：  
Ubuntu环境下，Intellij Idea中键盘失效，即按下任何按键都没有反应。  
使用鼠标能够进行正常操作。

解决方案：  
Ubuntu环境下，默认安装了IBUS软件，这个问题就是由IBUS引起的。  
那么解决方案就是在idea中不使用IBUS就好了，我们可以借助于“XMODIFIERS”环境变量  
该变量的定义如下：  
To use XIM (X input method) server, users should set XMODIFIERS   
environment variable.   
For example, to use "ibus", users should set like 'XMODIFIERS="@im=ibus"'. 

如果不需要使用中文输入法，那么现在可以设置"XMODIFIERS=idea.sh"，然后把上面这行设置语句加到idea.sh脚本的"Run the IDE."语句前面就好

如果需要使用中文输入法，那么现在可以设置"XMODIFIERS=“@im=fcitx”"，然后把上面这行设置语句加到idea.sh脚本的"Run the IDE."语句前面就好

设置好的idea.sh部分内容如下：

 

 

**\[plain]** [view plain](http://blog.csdn.net/dslztx/article/details/46700165 "view plain") [copy](http://blog.csdn.net/dslztx/article/details/46700165 "copy")

 

1. XMODIFIERS=idea.sh #add this line
2. export XMODIFIERS  #add this line too
3. # ---------------------------------------------------------------------
4. # Run the IDE.
5. # ---------------------------------------------------------------------
6. while true ; do
7. eval "$JDK/bin/java" $ALL\_JVM\_ARGS -Djb.restart.code=88 $MAIN\_CLASS\_NAME "$@"
8. test $? -ne 88 && break
9. done

 

 

 

 

 

http://blog.csdn.net/a\_\_yes/article/details/51249077

> 最近从Ubuntu14.04升级到Ubuntu16.04,返现IDEA下面无法切换搜狗输入法,也无法输入中文,查可以下,网上说用ibus可以,但是我原来用搜狗也可以,后来找到了解决方法.

## 解决方法

在IDEA的bin目录下的idea.sh文件的前面加上

export XMODIFIERS=@im=fcitx

export QT\_IM\_MODULE=fcitx