나는 태블릿 모드로 전환할 수 있고 화면 방향을 전환하는 가속도계가 있는 2022 HP 14" Spectre x360을 가지고 있습니다. 그러나 Ubuntu 22.04를 설치했을 때 태블릿 모드로 전환하거나 태블릿 모드에서 전환하여 화면 방향 또는 덮개를 닫거나 열면 모두 비행기 모드로 전환됩니다.
이는 HP 노트북에서 상대적으로 일반적인 문제인 것 같습니다(이전 Spectre에서는 이 문제를 경험한 적이 없지만). 첫 번째 답변에 수정 사항이 있습니다.이 게시물, 하지만 불행히도 내 시스템에서는 작동하지 않는 것 같습니다.
이 수정 사항은 "뚜껑 닫기" 및 "방향" 작업(각각 e057 및 e058)에 대한 키 코드를 "KEY_UNKNOWN" 키 코드(240)로 설정하는 데 의존합니다. 내 시스템에서 작동하지 않는 이유에 대한 내 이론은 어떤 이유로 내 새 노트북이나 Ubuntu 22.04가 덮개를 닫고 방향을 변경하기 위한 작업 ID를 변경했기 때문입니다. 을 사용하여 새 키코드를 알아내려고 했지만 xev
방향/태블릿 모드를 전환해도 아무 것도 표시되지 않았고 덮개를 닫으면 도움이 되지 않는 출력이 나왔습니다(아래 참조).
MappingNotify event, serial 37, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
FocusOut event, serial 37, synthetic NO, window 0x3400001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 38, synthetic NO, window 0x3400001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 38, synthetic NO, window 0x0,
keys: 4294967225 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
FocusOut event, serial 38, synthetic NO, window 0x3400001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 38, synthetic NO, window 0x3400001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 38, synthetic NO, window 0x0,
keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
FocusOut event, serial 38, synthetic NO, window 0x3400001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 38, synthetic NO, window 0x3400001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 38, synthetic NO, window 0x0,
keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
MappingNotify event, serial 38, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 38, synthetic NO, window 0x3400001,
root 0x7b9, subw 0x0, time 3122108, (1160,-364), root:(1209,776),
state 0x0, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 39, synthetic NO, window 0x3400001,
root 0x7b9, subw 0x0, time 3122125, (1160,-364), root:(1209,776),
state 0x0, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
PropertyNotify event, serial 39, synthetic NO, window 0x3400001,
atom 0x1a4 (_GTK_EDGE_CONSTRAINTS), time 3122199, state PropertyNewValue
PropertyNotify event, serial 39, synthetic NO, window 0x3400001,
atom 0x1a4 (_GTK_EDGE_CONSTRAINTS), time 3122203, state PropertyNewValue
KeyPress event, serial 39, synthetic NO, window 0x3400001,
root 0x7b9, subw 0x0, time 3123167, (1160,-364), root:(1209,776),
state 0x0, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 39, synthetic NO, window 0x3400001,
root 0x7b9, subw 0x0, time 3123184, (1160,-364), root:(1209,776),
state 0x0, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
PropertyNotify event, serial 39, synthetic NO, window 0x3400001,
atom 0x1a4 (_GTK_EDGE_CONSTRAINTS), time 3123191, state PropertyNewValue
PropertyNotify event, serial 39, synthetic NO, window 0x3400001,
atom 0x1a4 (_GTK_EDGE_CONSTRAINTS), time 3123197, state PropertyNewValue
MappingNotify event, serial 39, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
FocusOut event, serial 39, synthetic NO, window 0x3400001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 40, synthetic NO, window 0x3400001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 40, synthetic NO, window 0x0,
keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
FocusOut event, serial 40, synthetic NO, window 0x3400001,
mode NotifyNormal, detail NotifyNonlinear
PropertyNotify event, serial 40, synthetic NO, window 0x3400001,
atom 0x175 (_NET_WM_STATE), time 3151384, state PropertyNewValue
PropertyNotify event, serial 40, synthetic NO, window 0x3400001,
atom 0x1a4 (_GTK_EDGE_CONSTRAINTS), time 3151384, state PropertyNewValue
MappingNotify event, serial 40, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
journalctl -f
또한 태블릿 모드 전환, 방향 전환 또는 뚜껑 열기/닫기 시 다음과 같은 출력을 제공하는 을 살펴보았습니다 .
Aug 27 10:48:57 puter gnome-shell[2029]: Window manager warning: Overwriting existing binding of keysym 32 with keysym 32 (keycode b).
Aug 27 10:48:57 puter gnome-shell[2029]: Window manager warning: Overwriting existing binding of keysym 31 with keysym 31 (keycode a).
Aug 27 10:48:57 puter gnome-shell[2029]: Window manager warning: Overwriting existing binding of keysym 33 with keysym 33 (keycode c).
Aug 27 10:48:57 puter gnome-shell[2029]: Window manager warning: Overwriting existing binding of keysym 34 with keysym 34 (keycode d).
Aug 27 10:48:57 puter gnome-shell[2029]: Window manager warning: Overwriting existing binding of keysym 35 with keysym 35 (keycode e).
Aug 27 10:48:57 puter gnome-shell[2029]: Window manager warning: Overwriting existing binding of keysym 36 with keysym 36 (keycode f).
Aug 27 10:48:57 puter gnome-shell[2029]: Window manager warning: Overwriting existing binding of keysym 37 with keysym 37 (keycode 10).
Aug 27 10:48:57 puter gnome-shell[2029]: Window manager warning: Overwriting existing binding of keysym 39 with keysym 39 (keycode 12).
Aug 27 10:48:57 puter gnome-shell[2029]: Window manager warning: Overwriting existing binding of keysym 38 with keysym 38 (keycode 11).
Aug 27 10:48:57 puter systemd[1]: Starting Load/Save RF Kill Switch Status...
Aug 27 10:48:57 puter NetworkManager[675]: <info> [1661618937.7480] manager: rfkill: Wi-Fi now enabled by radio killswitch
Aug 27 10:48:57 puter systemd[1]: Started Load/Save RF Kill Switch Status.
Aug 27 10:48:58 puter NetworkManager[675]: <info> [1661618938.0189] manager: rfkill: WWAN hardware radio set enabled
Aug 27 10:48:58 puter NetworkManager[675]: <info> [1661618938.0193] audit: op="radio-control" arg="wwan-enabled:on" pid=2237 uid=1000 result="success"
Aug 27 10:48:58 puter NetworkManager[675]: <info> [1661618938.0543] device (wlo1): supplicant interface state: internal-starting -> disconnected
Aug 27 10:48:58 puter NetworkManager[675]: <info> [1661618938.0544] device (p2p-dev-wlo1): state change: unavailable -> unmanaged (reason 'removed', sys-iface-state: 'removed')
Aug 27 10:48:58 puter NetworkManager[675]: <info> [1661618938.0549] Wi-Fi P2P device controlled by interface wlo1 created
Aug 27 10:48:58 puter NetworkManager[675]: <info> [1661618938.0552] manager: (p2p-dev-wlo1): new 802.11 Wi-Fi P2P device (/org/freedesktop/NetworkManager/Devices/7)
Aug 27 10:48:58 puter NetworkManager[675]: <info> [1661618938.0554] device (p2p-dev-wlo1): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Aug 27 10:48:58 puter NetworkManager[675]: <info> [1661618938.0558] device (wlo1): state change: unavailable -> disconnected (reason 'supplicant-available', sys-iface-state: 'managed')
Aug 27 10:48:58 puter NetworkManager[675]: <info> [1661618938.0563] device (p2p-dev-wlo1): state change: unavailable -> disconnected (reason 'none', sys-iface-state: 'managed')
Aug 27 10:48:58 puter gnome-shell[2029]: Removing a network device that was not added
Aug 27 10:49:01 puter wpa_supplicant[696]: wlo1: CTRL-EVENT-REGDOM-CHANGE init=DRIVER type=COUNTRY alpha2=US
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2389] policy: auto-activating connection 'hcdj' (4888999a-9a1c-4c66-9e1a-a833d092f6c0)
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2396] device (wlo1): Activation: starting connection 'hcdj' (4888999a-9a1c-4c66-9e1a-a833d092f6c0)
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2397] device (wlo1): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2401] manager: NetworkManager state is now CONNECTING
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2403] device (wlo1): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2407] device (wlo1): Activation: (wifi) access point 'hcdj' has security, but secrets are required.
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2408] device (wlo1): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2425] device (wlo1): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2428] device (wlo1): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2431] device (wlo1): Activation: (wifi) connection 'hcdj' has security, and secrets exist. No new secrets needed.
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2432] Config: added 'ssid' value 'hcdj'
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2432] Config: added 'scan_ssid' value '1'
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2432] Config: added 'bgscan' value 'simple:30:-70:86400'
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2433] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK SAE FT-SAE'
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2433] Config: added 'auth_alg' value 'OPEN'
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2433] Config: added 'psk' value '<hidden>'
Aug 27 10:49:01 puter wpa_supplicant[696]: wlo1: SME: Trying to authenticate with 58:24:29:94:95:3a (SSID='hcdj' freq=5745 MHz)
Aug 27 10:49:01 puter kernel: wlo1: authenticate with 58:24:29:94:95:3a
Aug 27 10:49:01 puter kernel: wlo1: send auth to 58:24:29:94:95:3a (try 1/3)
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2651] device (wlo1): supplicant interface state: disconnected -> authenticating
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.2652] device (p2p-dev-wlo1): supplicant management interface state: disconnected -> authenticating
Aug 27 10:49:01 puter wpa_supplicant[696]: wlo1: Trying to associate with 58:24:29:94:95:3a (SSID='hcdj' freq=5745 MHz)
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.3030] device (wlo1): supplicant interface state: authenticating -> associating
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.3031] device (p2p-dev-wlo1): supplicant management interface state: authenticating -> associating
Aug 27 10:49:01 puter kernel: wlo1: authenticated
Aug 27 10:49:01 puter kernel: wlo1: associate with 58:24:29:94:95:3a (try 1/3)
Aug 27 10:49:01 puter kernel: wlo1: RX AssocResp from 58:24:29:94:95:3a (capab=0x1011 status=0 aid=8)
Aug 27 10:49:01 puter wpa_supplicant[696]: wlo1: Associated with 58:24:29:94:95:3a
Aug 27 10:49:01 puter wpa_supplicant[696]: wlo1: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Aug 27 10:49:01 puter kernel: wlo1: associated
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.3324] device (wlo1): supplicant interface state: associating -> 4way_handshake
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.3324] device (p2p-dev-wlo1): supplicant management interface state: associating -> 4way_handshake
Aug 27 10:49:01 puter wpa_supplicant[696]: wlo1: WPA: Key negotiation completed with 58:24:29:94:95:3a [PTK=CCMP GTK=CCMP]
Aug 27 10:49:01 puter wpa_supplicant[696]: wlo1: CTRL-EVENT-CONNECTED - Connection to 58:24:29:94:95:3a completed [id=0 id_str=]
Aug 27 10:49:01 puter kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlo1: link becomes ready
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.3791] device (wlo1): supplicant interface state: 4way_handshake -> completed
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.3792] device (wlo1): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Connected to wireless network "hcdj"
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.3793] device (p2p-dev-wlo1): supplicant management interface state: 4way_handshake -> completed
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.3795] device (wlo1): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.3803] dhcp4 (wlo1): activation: beginning transaction (timeout in 45 seconds)
Aug 27 10:49:01 puter avahi-daemon[669]: Joining mDNS multicast group on interface wlo1.IPv6 with address fe80::821d:62c4:9abf:42fa.
Aug 27 10:49:01 puter avahi-daemon[669]: New relevant interface wlo1.IPv6 for mDNS.
Aug 27 10:49:01 puter avahi-daemon[669]: Registering new address record for fe80::821d:62c4:9abf:42fa on wlo1.*.
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.4146] dhcp4 (wlo1): state changed new lease, address=192.168.86.82
Aug 27 10:49:01 puter kernel: wlo1: Limiting TX power to 30 (30 - 0) dBm as advertised by 58:24:29:94:95:3a
Aug 27 10:49:01 puter avahi-daemon[669]: Joining mDNS multicast group on interface wlo1.IPv4 with address 192.168.86.82.
Aug 27 10:49:01 puter avahi-daemon[669]: New relevant interface wlo1.IPv4 for mDNS.
Aug 27 10:49:01 puter avahi-daemon[669]: Registering new address record for 192.168.86.82 on wlo1.IPv4.
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.4191] device (wlo1): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Aug 27 10:49:01 puter dbus-daemon[673]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.10' (uid=0 pid=675 comm="/usr/sbin/NetworkManager --no-daemon " label="unconfined")
Aug 27 10:49:01 puter systemd[1]: Starting Network Manager Script Dispatcher Service...
Aug 27 10:49:01 puter dbus-daemon[673]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Aug 27 10:49:01 puter systemd[1]: Started Network Manager Script Dispatcher Service.
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.4349] device (wlo1): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.4351] device (wlo1): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.4354] manager: NetworkManager state is now CONNECTED_LOCAL
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.4367] manager: NetworkManager state is now CONNECTED_SITE
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.4368] policy: set 'hcdj' (wlo1) as default for IPv4 routing and DNS
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.4380] device (wlo1): Activation: successful, device activated.
Aug 27 10:49:01 puter systemd-resolved[607]: wlo1: Bus client set search domain list to: lan
Aug 27 10:49:01 puter systemd-resolved[607]: wlo1: Bus client set default route setting: yes
Aug 27 10:49:01 puter systemd-resolved[607]: wlo1: Bus client set DNS server list to: 192.168.86.1
Aug 27 10:49:01 puter wpa_supplicant[696]: wlo1: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-54 noise=9999 txrate=234000
Aug 27 10:49:01 puter NetworkManager[675]: <info> [1661618941.5717] manager: NetworkManager state is now CONNECTED_GLOBAL
Aug 27 10:49:02 puter systemd[1]: systemd-rfkill.service: Deactivated successfully.
Aug 27 10:49:06 puter NetworkManager[675]: <info> [1661618946.0826] manager: rfkill: Wi-Fi now disabled by radio killswitch
Aug 27 10:49:06 puter NetworkManager[675]: <info> [1661618946.0827] device (wlo1): state change: activated -> unavailable (reason 'none', sys-iface-state: 'managed')
Aug 27 10:49:06 puter systemd[1]: Starting Load/Save RF Kill Switch Status...
Aug 27 10:49:06 puter kernel: wlo1: deauthenticating from 58:24:29:94:95:3a by local choice (Reason: 3=DEAUTH_LEAVING)
Aug 27 10:49:06 puter NetworkManager[675]: <info> [1661618946.0829] dhcp4 (wlo1): canceled DHCP transaction
Aug 27 10:49:06 puter NetworkManager[675]: <info> [1661618946.0829] dhcp4 (wlo1): activation: beginning transaction (timeout in 45 seconds)
Aug 27 10:49:06 puter NetworkManager[675]: <info> [1661618946.0830] dhcp4 (wlo1): state changed no lease
Aug 27 10:49:06 puter systemd[1]: Started Load/Save RF Kill Switch Status.
Aug 27 10:49:06 puter wpa_supplicant[696]: wlo1: CTRL-EVENT-DISCONNECTED bssid=58:24:29:94:95:3a reason=3 locally_generated=1
Aug 27 10:49:06 puter wpa_supplicant[696]: BSSID 58:24:29:94:95:3a ignore list count incremented to 2, ignoring for 10 seconds
Aug 27 10:49:06 puter avahi-daemon[669]: Interface wlo1.IPv6 no longer relevant for mDNS.
Aug 27 10:49:06 puter avahi-daemon[669]: Leaving mDNS multicast group on interface wlo1.IPv6 with address fe80::821d:62c4:9abf:42fa.
Aug 27 10:49:06 puter avahi-daemon[669]: Interface wlo1.IPv4 no longer relevant for mDNS.
Aug 27 10:49:06 puter avahi-daemon[669]: Leaving mDNS multicast group on interface wlo1.IPv4 with address 192.168.86.82.
Aug 27 10:49:06 puter avahi-daemon[669]: Withdrawing address record for fe80::821d:62c4:9abf:42fa on wlo1.
Aug 27 10:49:06 puter avahi-daemon[669]: Withdrawing address record for 192.168.86.82 on wlo1.
Aug 27 10:49:06 puter wpa_supplicant[696]: rfkill: WLAN soft blocked
Aug 27 10:49:06 puter wpa_supplicant[696]: rfkill: WLAN soft blocked
Aug 27 10:49:06 puter systemd-resolved[607]: wlo1: Bus client reset search domain list.
Aug 27 10:49:06 puter systemd-resolved[607]: wlo1: Bus client set default route setting: no
Aug 27 10:49:06 puter systemd-resolved[607]: wlo1: Bus client reset DNS server list.
Aug 27 10:49:06 puter NetworkManager[675]: <info> [1661618946.1568] manager: NetworkManager state is now DISCONNECTED
Aug 27 10:49:06 puter wpa_supplicant[696]: p2p-dev-wlo1: CTRL-EVENT-DSCP-POLICY clear_all
Aug 27 10:49:06 puter wpa_supplicant[696]: p2p-dev-wlo1: CTRL-EVENT-DSCP-POLICY clear_all
Aug 27 10:49:06 puter wpa_supplicant[696]: nl80211: deinit ifname=p2p-dev-wlo1 disabled_11b_rates=0
Aug 27 10:49:06 puter wpa_supplicant[696]: wlo1: CTRL-EVENT-DSCP-POLICY clear_all
Aug 27 10:49:06 puter NetworkManager[675]: <info> [1661618946.2158] device (p2p-dev-wlo1): state change: disconnected -> unavailable (reason 'supplicant-failed', sys-iface-state: 'managed')
Aug 27 10:49:06 puter NetworkManager[675]: <info> [1661618946.2379] manager: rfkill: WWAN hardware radio set disabled
Aug 27 10:49:06 puter NetworkManager[675]: <info> [1661618946.2380] audit: op="radio-control" arg="wwan-enabled:off" pid=2237 uid=1000 result="success"
Aug 27 10:49:06 puter wpa_supplicant[696]: wlo1: CTRL-EVENT-DSCP-POLICY clear_all
Aug 27 10:49:06 puter wpa_supplicant[696]: nl80211: deinit ifname=wlo1 disabled_11b_rates=0
Aug 27 10:49:08 puter google-chrome.desktop[2759]: [2753:2782:0827/104908.122472:ERROR:connection_factory_impl.cc(425)] Failed to connect to MCS endpoint with error -106
Aug 27 10:49:11 puter systemd[1]: systemd-rfkill.service: Deactivated successfully.
Aug 27 10:49:16 puter systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
여러 키 ID로 시작하지만 그 중 하나를 변경해도 문제가 해결되지 않습니다.
그래서 제 질문은 노트북 화면을 변경할 때 비행기 모드를 방지하기 위해 어떤 키 ID를 240으로 설정할지 알아내는 가장 좋은 방법이 무엇인지인 것 같습니다.
답변1
비행기 모드가 활성화되고 비활성화되는 것과 동일한 문제가 있었습니다(적어도 뚜껑을 움직일 때).
- 장치: HP HP Spectre x360 2-in-1 노트북 14-ef2xxx
- 독일어 키보드 사용
- 우분투 22.04 LTS
스캔코드 e057 및 e058을 키코드 240에 매핑해도 도움이 되지 않았습니다. 사용
sudo showkey
뚜껑을 움직이면 뚜껑이 테이블(또는 랩:D)을 기준으로 앞뒤 방향으로 약 45도 각도인 특정 각도를 가로지르면 키 247(내 컴퓨터의 비행기 모드)이 눌렸다가 해제되는 것을 알 수 있습니다.
그러나 동일한 과정을 반복하여
sudo showkey -s
스캔코드가 활성화되지 않았음을 나타냅니다. 따라서 setkeycodes
.
[2]와 비슷한 [1]의 도움으로 문제를 해결했습니다. 후자의 일대일 방식은 나에게 적합하지 않았습니다. 분명히 키 매핑의 영향을 받으려면 작성자와 다른 장치가 필요했습니다.
정말 오랜 시간 동안 답변을 찾고, 시행착오를 겪고, 전문가 수준의 게시물에 혼란스러워 했습니다. 적어도 나는 뭔가를 배웠다. 여러분과 다른 사람들이 그런 일을 겪지 않기를 바라며, 저는 이 단계별 솔루션을 가능한 한 초보자 친화적으로 만들려고 노력합니다.
해당 장치 찾기
Ctrl + Alt + T를 통해 터미널을 엽니다.
입력(그런 다음 Enter)
cat /proc/bus/input/devices
장치 목록을 얻으려면. "Intel HID 이벤트"라는 것입니다.
I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="Intel HID events"
P: Phys=
S: Sysfs=/devices/platform/INTC1070:00/input/input35
U: Uniq=
H: Handlers=rfkill kbd event17
B: PROP=0
B: EV=13
B: KEY=1000300000000 5000004000 1e294000000020 0
B: MSC=10
핸들러로 rfkill(모든 라디오, 즉 wlan, 블루투스 등 비활성화)이 있기 때문에 책임이 있을 수 있습니다. 나는 그것을 ~라고 부를 것이다장치지금부터.
키코드 받기
장치를 테스트하고 키코드를 받기 전에 evtest를 설치하세요. 입력(다음에 입력)
sudo apt install -y evtest
메시지가 나타나면 비밀번호를 입력하세요. 장치가 작동하는지 테스트하고 키코드를 얻으려면 가상 터미널을 엽니다(일반 터미널 X에서는 기본적으로 Ubuntu GUI로 인해 이 테스트가 불가능할 수 있습니다). 종종 이 작업은 Ctrl + Alt + F1을 통해 수행되지만 제 경우에는 F1을 F3으로 바꿔야 합니다. X로 돌아가려면 Ctrl + Alt + F2(제 경우)를 누르세요. 다른 컴퓨터에서는 F7인 경우가 많습니다. 시행착오를 거쳐 나에게 딱 맞는 키를 찾았습니다.
사용자 이름과 비밀번호를 입력하세요. 입력(그런 다음 Enter)
sudo evtest /dev/input/event17
제 경우에는 event17입니다. 이는 장치의 Handler 필드에 있었기 때문입니다. 위를 참조하세요. 예를 들어 마우스와 키보드를 노트북에 연결하면 숫자가 변경되는 것을 확인했습니다. 따라서 귀하의 경우에는 다른 번호가 될 수 있습니다.
다음으로 뚜껑을 닫았다가 엽니다. Ctrl + C를 통해 evtest 테스트 모드를 종료하고 Ctrl + Alt + F2를 통해 가상 터미널을 종료합니다(제 경우). 내 화면에는 evtest 중에 다음이 인쇄되었습니다.
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "Intel HID events"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 69 (KEY_NUMLOCK)
Event code 102 (KEY_HOME)
Event code 104 (KEY_PAGEUP)
Event code 107 (KEY_END)
Event code 109 (KEY_PAGEDOWN)
Event code 113 (KEY_MUTE)
Event code 114 (KEY_VOLUMEDOWN)
Event code 115 (KEY_VOLUMEUP)
Event code 116 (KEY_POWER)
Event code 142 (KEY_SLEEP)
Event code 164 (KEY_PLAYPAUSE)
Event code 166 (KEY_STOPCD)
Event code 224 (KEY_BRIGHTNESSDOWN)
Event code 225 (KEY_BRIGHTNESSUP)
Event code 240 (KEY_UNKNOWN)
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1684340717.813043, type 4 (EV_MSC), code 4 (MSC_SCAN), value 08
Event: time 1684340717.813043, type 1 (EV_KEY), code 247 (KEY_RFKILL), value 1
Event: time 1684340717.813043, -------------- SYN_REPORT ------------
Event: time 1684340717.813055, type 1 (EV_KEY), code 247 (KEY_RFKILL), value 0
Event: time 1684340717.813055, -------------- SYN_REPORT ------------
Event: time 1684340721.308956, type 4 (EV_MSC), code 4 (MSC_SCAN), value 08
Event: time 1684340721.308956, type 1 (EV_KEY), code 247 (KEY_RFKILL), value 1
Event: time 1684340721.308956, -------------- SYN_REPORT ------------
Event: time 1684340721.308963, type 1 (EV_KEY), code 247 (KEY_RFKILL), value 0
Event: time 1684340721.308963, -------------- SYN_REPORT ------------
이것을 파일로 인쇄하려면 홈 디렉토리에 evtest_output.txt라고 말하고 ~
다음을 입력하십시오.
sudo evtest /dev/input/event17 > ~/evtest_output.txt
대신 위 단계에서. 하지만 테스트 중에는 화면에 인쇄된 출력이 표시되지 않습니다.
evtest_output.txt의 내용을 살펴보겠습니다. 먼저, 일부 장치 사양과 지원되는 이벤트를 알려줍니다. 그 아래에는 Testing...
뚜껑이 움직이는 동안 인쇄된 10개의 이벤트가 있습니다. 전자의 5개 사건은 닫힘에 속하고, 후자의 5개 사건은 뚜껑을 여는 것에 속한다. 완전히 닫지는 않습니다. 비행기 모드를 실행하려면 약 45도 정도 기울이면 충분합니다. 이는 "Intel HID 이벤트" 장치가 책임이 있음을 확인합니다.
hwdb로 수정
hwdb를 사용하여 이 문제를 해결하기 위해 터미널에 입력(그런 다음 Enter)하여 intel-HID-events.hwdb 파일을 만들었습니다.
sudo nano /etc/udev/hwdb.d/intel-HID-events.hwdb
제가 입력한 내용은 (저의 경우)
evdev:input:b0019v0000p0000e0000-*
KEYBOARD_KEY_08=unknown
첫 번째 줄의 숫자는 장치의 버스(0019), 공급업체(0000), 제품(0000) 및 버전(0000) 필드입니다( cat /proc/us/input/devices
위 프롬프트 출력 참조). 뒤에 나오는 별표는 *
여러 기호에 대한 자리 표시자입니다. 그러나 [1]에서와 같이 더 이상 지정하지 않았습니다. 내 이유는 다른 하드웨어(예: 마우스)를 연결 해제할 때 장치의 모달리아가 변경되는 것처럼 보이기 때문입니다.
두 번째 줄의 들여쓰기에 주목하세요. evtest에서 닫거나 열 때 첫 번째 이벤트의 값(MSC_SCAN 이후)인 키 08은 알 수 없음으로 설정됩니다.
Ctrl + O로 저장하고 Enter를 누른 다음 Ctrl + X로 닫습니다. 그런 다음 다음을 통해 업데이트하세요.
sudo systemd-hwdb update
sudo udevadm trigger
[2]에서 나온 내용입니다.
뚜껑을 움직여 보세요. 더 이상 비행기 모드를 실행해서는 안 됩니다. [2]에서처럼 이러한 변경 사항을 "영구적으로" 만들 필요는 없었습니다. 재부팅 후에도 문제는 여전히 해결됩니다. 다음 업데이트에서 수정 사항이 해결되는지 살펴보겠습니다.
이것이 당신이나 누구에게나 도움이 되기를 바랍니다!
건배 jk
참고자료
[1]https://yulistic.gitlab.io/2017/12/linux-keymapping-with-udev-hwdb/