How can I make my numpad act like numbers?

4 ビュー (過去 30 日間)
Stan Kruger
Stan Kruger 2015 年 2 月 5 日
コメント済み: Stan Kruger 2016 年 2 月 12 日
Matlab 2014b, linux.
I'm experiencing some strange numpad bindings with this version.
The keys along the top row function properly, but the numpad keys do not. This does happen whether the key mappings are "windows" or "emacs" mode. This does not happen if matlab is run from windows.
1, 2, 3, 5, and 6 function normally 4 deletes the previous character and replaces it with a 4 7 deletes the previous text in that line and replaces it with a 7 8 deletes the previous text in that line, moves up a line, and inserts an 8 9 deletes all of the editor text behind the cursor and replaces it with a 9.
I have no idea what's going on or how to fix it, I just want my numpad to act like numbers. Ideas?
  1 件のコメント
Steven Theriault
Steven Theriault 2015 年 12 月 4 日
編集済み: Steven Theriault 2015 年 12 月 4 日
Have you found a solution for this problem? I have the same issue.
One additional bit of important information: the number pad works everywhere except Matlab, eg termal window, text editors, etc.

サインインしてコメントする。

採用された回答

Jason Bell
Jason Bell 2016 年 2 月 12 日
I stumbled across this question as I was having the same problems (on MATLAB 2013b and 2015b).
I have created a workaround, in which users use “xmodmap” to change the “numpad” values for each of the keys.
I created a script “numkey-fix.sh” which contains the following
> cat numkey-fix.sh
xmodmap -e "keycode 79 = 7"
xmodmap -e "keycode 80 = 8"
xmodmap -e "keycode 81 = 9"
xmodmap -e "keycode 83 = 4"
xmodmap -e "keycode 84 = 5"
xmodmap -e "keycode 85 = 6"
xmodmap -e "keycode 87 = 1"
xmodmap -e "keycode 88 = 2"
xmodmap -e "keycode 89 = 3"
xmodmap -e "keycode 90 = 0"
The issue is that with the newer versions of “X Windows” for Linux, it uses a different values for these keys which matlab doesn’t understand correctly and causes the issues described above.
So I execute this script before starting matlab and the issues should be fixed.
Basically, what is does is changes the default values, which looks something like
xmodmap -e "keycode 79 = KP_7"
xmodmap -e "keycode 80 = KP_8"
xmodmap -e "keycode 81 = KP_9"
xmodmap -e "keycode 83 = KP_4"
xmodmap -e "keycode 84 = KP_5"
xmodmap -e "keycode 85 = KP_6"
xmodmap -e "keycode 87 = KP_1"
xmodmap -e "keycode 88 = KP_2"
xmodmap -e "keycode 89 = KP_3"
xmodmap -e "keycode 90 = KP_0"
Hopefully this might be useful to others.
Cheers, Jason.
  1 件のコメント
Stan Kruger
Stan Kruger 2016 年 2 月 12 日
Great fix, thanks! Over a year later this had still been irritating me. I should also mention that this issue wasn't specific to MATLAB, my terminal windows were having similar screwed up bindings. This fix has resolved that issue as well.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCommunications Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by