Tengo un HP Spectre x360 de 14" 2022, que puede pasar al modo tableta y tiene un acelerómetro para cambiar la orientación de la pantalla. Sin embargo, cuando instalé Ubuntu 22.04 en él, descubrí que al encenderlo o salir del modo tableta, cambiar el orientación de la pantalla, o cerrar o abrir la tapa, todos alternan el modo avión.
Este parece ser un problema relativamente común en las computadoras portátiles HP (aunque mi Spectre anterior nunca lo experimentó). Hay una solución para encontrar en la primera respuesta aesta publicación, pero desafortunadamente no parece funcionar en mi sistema.
Esta solución se basa en configurar los códigos clave para las acciones "cerrar tapa" y "orientar" (e057 y e058 respectivamente) en el código clave "KEY_UNKNOWN" (240). Mi teoría de por qué no funcionará para mi sistema es porque, por alguna razón, mi nueva computadora portátil o Ubuntu 22.04 cambiaron los ID de acción para cerrar la tapa y cambiar la orientación. Intenté descifrar los nuevos códigos clave usando xev
, pero cambiar de orientación/modo de tableta no mostró nada, y cerrar la tapa dio un resultado que no encontré útil (como se ve a continuación):
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
También miré journalctl -f
, que proporciona el siguiente resultado al cambiar el modo de tableta, cambiar la orientación o abrir/cerrar la tapa:
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.
Comienza con varias ID de clave, pero cambiar cualquiera de ellas no soluciona el problema.
Entonces, supongo que mi pregunta es cuál es la mejor manera de determinar qué ID de clave configurar en 240 para evitar el modo avión al cambiar la pantalla de mi computadora portátil.
Respuesta1
Tuve el mismo problema de que se activaba y desactivaba el modo avión (al menos al mover la tapa).
- dispositivo: Laptop HP HP Spectre x360 2 en 1 14-ef2xxx
- con teclado alemán
- Ubuntu 22.04 LTS
La asignación de códigos de escaneo e057 y e058 al código clave 240 no ayudó. Usando
sudo showkey
y mover la tapa muestra que la tecla 247 (que es el modo avión en mi máquina) se presiona y suelta si la tapa cruza ciertos ángulos, aproximadamente 45 grados con respecto a la mesa (o regazo: D) tanto hacia adelante como hacia atrás.
Sin embargo, repitiendo el mismo procedimiento con
sudo showkey -s
muestra que no hay códigos de escaneo activados. Por lo tanto, esto probablemente no se pueda solucionar simplemente asignando algún código de escaneo a algún código clave usando setkeycodes
.
Lo arreglé con la ayuda de [1], que es similar a [2]. Seguir este último uno a uno no funcionó para mí. Aparentemente, necesitaba un dispositivo diferente al del autor para que me afectara la asignación de claves.
Pasé mucho tiempo buscando respuestas, prueba y error, y confundiéndome con publicaciones escritas a nivel de expertos. Al menos aprendí algo. Con suerte, para evitarle a usted y a otros esto, trato de hacer que esta solución paso a paso sea lo más amigable posible para los principiantes.
Encuentra el dispositivo responsable
Abra una terminal mediante Ctrl + Alt + T.
Escriba (luego Ingrese)
cat /proc/bus/input/devices
para obtener una lista de dispositivos. El que se llama "eventos 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
podría ser responsable, porque tiene rfkill (desactivar todas las radios, es decir, wlan, bluetooth, etc.) como controlador. lo llamaré eldispositivoa partir de aquí.
Obtener los códigos clave
Antes de probar el dispositivo y obtener los códigos clave, instale evtest. Escribe (luego ingresa)
sudo apt install -y evtest
Proporcione su contraseña si se le solicita. Para probar si el dispositivo es responsable y obtener los códigos clave, abra una terminal virtual (en una terminal X normal, básicamente su GUI de Ubuntu, puede hacer que esta prueba sea imposible). A menudo, esto se hace mediante Ctrl + Alt + F1, pero en mi caso, F1 debe reemplazarse por F3. Para volver a X, presione Ctrl + Alt + F2 (en mi caso). En otras máquinas suele aparecer F7. Encontré las claves adecuadas para mí mediante prueba y error.
Proporcione su nombre de usuario y contraseña. Escriba (luego Ingrese)
sudo evtest /dev/input/event17
En mi caso es el evento 17, porque estaba en el campo Controlador del dispositivo, ver arriba. Noté que el número cambia si conecto, por ejemplo, un mouse y un teclado a mi computadora portátil. Por lo tanto, en su caso podría ser un número diferente.
A continuación, cierre y abra la tapa. Salga del modo de prueba de evtest mediante Ctrl + C y salga de la terminal virtual mediante Ctrl + Alt + F2 (en mi caso). En mi pantalla, esto se imprimió durante el 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 ------------
Si desea que esto se imprima en un archivo, diga evtest_output.txt en su directorio de inicio ~
, escriba
sudo evtest /dev/input/event17 > ~/evtest_output.txt
en su lugar, en el paso anterior. Sin embargo, tenga en cuenta que no verá el resultado impreso en la pantalla durante la prueba.
Examinemos el contenido de evtest_output.txt. Primero, nos dice algunas especificaciones del dispositivo y los eventos admitidos. Debajo Testing...
hay diez eventos que se imprimieron durante el movimiento de la tapa. Los primeros cinco eventos pertenecen al cierre y los últimos cinco eventos a la apertura de la tapa. Tenga en cuenta que no lo cierro por completo. Una inclinación de unos 45 grados es suficiente para activar el modo avión. Esto confirma que el dispositivo "Intel HID events" es el responsable.
Arreglar con hwdb
Para solucionar este problema usando hwdb, creé el archivo intel-HID-events.hwdb escribiendo en la terminal (luego Enter)
sudo nano /etc/udev/hwdb.d/intel-HID-events.hwdb
Los contenidos que escribí son (en mi caso)
evdev:input:b0019v0000p0000e0000-*
KEYBOARD_KEY_08=unknown
Los números en la primera línea son los campos bus (0019), proveedor (0000), producto (0000) y versión (0000) del dispositivo (consulte el resultado del cat /proc/us/input/devices
mensaje anterior). El asterisco *
que sigue es un marcador de posición para cualquier número de símbolos. Sin embargo, no especifiqué más, como se hace en [1]. Mi razón es que las modalidades del dispositivo parecen cambiar cuando (des)conecto otro hardware, por ejemplo, mi mouse.
Tenga en cuenta la sangría de la segunda línea. La clave 08, que es el valor (después de MSC_SCAN) del primer evento al cerrar o abrir en evtest, está configurada como desconocida.
Guarde con Ctrl + O, Enter y cierre con Ctrl + X. Luego actualice mediante
sudo systemd-hwdb update
sudo udevadm trigger
Esto es de [2].
Mueve la tapa. Ya no debería activar el modo avión. No tuve que hacer estos cambios "permanentes" como se hace en [2]. Después de reiniciar, el problema aún está solucionado. Veamos si la próxima actualización corrige la solución...
¡Espero que esto te ayude a ti o a cualquiera!
Saludos jk
Referencias
[1]https://yulistic.gitlab.io/2017/12/linux-keymapping-with-udev-hwdb/
[2]Cambio del modo avión al cambiar al modo tableta (HP Spectre x360)