You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 17.10键盘按键映射异常求助:英文(UK)布局无效

Troubleshooting Keyboard Mapping Issues on Ubuntu 17.10 (UK English Layout)

Hey there, let's work through this keyboard mapping problem you're facing. It's super frustrating when keys don't output what you expect—even after switching layouts—so let's break this down step by step.

First, Verify Your Active Keyboard Layout

Sometimes the system might show you're using the UK layout, but the actual active configuration could be out of sync. Run these commands to check and reset if needed:

  1. Check current Xorg keyboard settings:

    setxkbmap -query
    

    You should see output focused on these lines (make sure layout is set to gb):

    layout: gb
    variant: (empty)
    options: (empty)

    If the layout isn't gb, or even if it is, reset it to default to rule out glitches:

    setxkbmap -layout gb -variant ""
    

    Test your problematic keys right after running this to see if the issue clears up.

  2. Check GNOME's input source setup (Ubuntu 17.10 uses GNOME by default):

    gsettings get org.gnome.desktop.input-sources sources
    

    This should return [('xkb', 'gb')] if only the UK layout is active. If other layouts are listed, they might be interfering—you can remove extras via Settings > Region & Language.

Dig Into Key Mappings with xmodmap

You mentioned running xmodmap -pke | grep slash—let's use this to examine how your slash-related keys are mapped.

First, share the full output of that command here. For reference, a typical UK layout maps the slash (/) to shift+# (the key to the right of L), with keycode mappings looking something like:

keycode  51 = numbersign slash numbersign slash dead_grave dead_breve dead_grave dead_breve

If your output shows different values for the keycode tied to your problematic key, that's likely the root cause.

Check for Custom Keyboard Configurations

Custom xmodmap settings or Xorg config files might be overriding the system layout:

  • Look for a ~/.Xmodmap file in your home directory. If it exists, rename it temporarily (e.g., mv ~/.Xmodmap ~/.Xmodmap.bak) and restart your session to test if the problem goes away.
  • Check /etc/X11/xorg.conf.d/ for custom keyboard configs (files like 90-keyboard.conf). If you find any, back them up and remove them temporarily to rule out conflicts.

Next Steps to Narrow It Down

If none of the above fixes the issue, please share:

  • The exact output of xmodmap -pke | grep slash
  • The output of setxkbmap -query
  • Which specific key(s) are behaving unexpectedly (e.g., pressing the key right of L outputs # instead of / when holding shift)

That extra detail will help pinpoint exactly where the mapping is going wrong.

内容的提问来源于stack exchange,提问作者Ots Wng

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 08:21:35