From nobody Sat Dec 24 08:37:04 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NfHTs0nZdz1HSmY; Sat, 24 Dec 2022 08:37:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NfHTr5c3rz3P7R; Sat, 24 Dec 2022 08:37:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671871024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kgHaDDjB7E2MXs0SdbtvedsIZO/JY5c2ppwmP/GbdfI=; b=j5+ToL4aTnjXU0obrj2J7suN8ln6b6XWB/YXXhkSmIIyapSO4Ru6iuIKip34jmPSOwzG1a 4UkMZvdD1tZoyxHDxgR+Psm7ScXokIpdGocv+qo/7noWbt01iR1mYDz2me2VNRVKPUAXiO 4VviYlOi+ojP6CL8/K7MPAV9XCfArWQeAHa6AVDNVK0Bc3kFc/O8SYBqof6o0xrtgTEJlf XiTx9KFlLUs3hiFVHz0bXqWZETR3Txuy/ADs3ZuMT3U0biGSq99d7qJhEKeaw5PoBWMoJz FvGZWx5yhWlAYQRnigYH97R8X32uo5it2xvcyn7BwWX380/W+it4/VNe2FY79Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671871024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kgHaDDjB7E2MXs0SdbtvedsIZO/JY5c2ppwmP/GbdfI=; b=Ky/5hAWWdP4HHykMdhKrrnfvep+tsLdKbk28yr5DYqV9OzJe9Yi08BOGYEGwLYToMsjuY7 IjtRLrdsdrXYZRGO4IjTbGEtjk98IOPVsfBXV+sZXiigYrgefplsCt1/lpUD7OU3b4pSXn hQDb82Ggxin88WWheSkb1MyQYqaWYokIqJZPPbFc7ouCVkL40eIyXJ+NwSHWc1buTK4Xa5 U9EUAfglk6livOHaa92xnonz1NWg2RbTQMCKrJ7UD0mXDrYvEAnsHgmK1T+ENkYD+WoMFh qEpzSowrD3l+7BHdzrEf/nz0oiQqnvmUQBKIdqUCU4EKNUmDr6+No9WNbmhrRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671871024; a=rsa-sha256; cv=none; b=P0QKb5QR5HFg1eRIPWZ/SSvAQgOcSHO2jBOs7t51tloD19032wPssQdSRXO6TICBoVuaoz V2Y7nsTyTd0aXbmYthOzIKU6eUXO7C0AU1M3sLCKh/w0PZuQNkJmCquPhXdZ6bXuegcdpO QrO8/nnRW5BerKpPuKuM2V9Usk/TshkFbMvz1HQ3lt1PEfHe0If7zDVCDQEklCmr2OGRRa qgRE5pozQ/m+xpv4RLKOWAp6XWJ5F+AcXPRzkDd+SqMNjVzcuTWdTb3KuDl3Lq1PijgW0p KGUXI3wGZytlqRZxhXCC5drT1LnGinOBOQclwaHN/zq79Tk/G1HVvVzwbjtX7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NfHTr4gxXz16Qx; Sat, 24 Dec 2022 08:37:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BO8b4It083529; Sat, 24 Dec 2022 08:37:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BO8b4ii083528; Sat, 24 Dec 2022 08:37:04 GMT (envelope-from git) Date: Sat, 24 Dec 2022 08:37:04 GMT Message-Id: <202212240837.2BO8b4ii083528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: bc814b75fd76 - stable/13 - atkbd(4): Fix "hancha" and "han/yong" korean keys handling. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bc814b75fd767b19293e73549182a6c824349425 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=bc814b75fd767b19293e73549182a6c824349425 commit bc814b75fd767b19293e73549182a6c824349425 Author: Vladimir Kondratyev AuthorDate: 2022-07-19 21:06:22 +0000 Commit: Vladimir Kondratyev CommitDate: 2022-12-24 08:33:27 +0000 atkbd(4): Fix "hancha" and "han/yong" korean keys handling. The Korean keyboard has two keys, the Korean/Chinese and the Korean/English toggles, that generate scancodes 0xF1 and 0xF2 (respectively) when pressed, and nothing when released. They do not repeat. As Hanyong/Hancha keys are generally greater than 0x80, which is generally considered a release key, add extra preceding press key event to generate press/release pair. Swap Hanyong/Hancha key codes to match reality. (cherry picked from commit 6a26c99f827ffa9da5e23d466eeb17131fc75238) --- sys/dev/atkbdc/atkbd.c | 10 ++++++++++ sys/dev/evdev/evdev_utils.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c index cee1207df973..9cf60dbcff57 100644 --- a/sys/dev/atkbdc/atkbd.c +++ b/sys/dev/atkbdc/atkbd.c @@ -684,6 +684,16 @@ next_code: #ifdef EVDEV_SUPPORT /* push evdev event */ if (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD && state->ks_evdev != NULL) { + /* "hancha" and "han/yong" korean keys handling */ + if (state->ks_evdev_state == 0 && + (scancode == 0xF1 || scancode == 0xF2)) { + keycode = evdev_scancode2key(&state->ks_evdev_state, + scancode & 0x7F); + evdev_push_event(state->ks_evdev, EV_KEY, + (uint16_t)keycode, 1); + evdev_sync(state->ks_evdev); + } + keycode = evdev_scancode2key(&state->ks_evdev_state, scancode); diff --git a/sys/dev/evdev/evdev_utils.c b/sys/dev/evdev/evdev_utils.c index 9bb58d9b7ba1..ec4a08f27016 100644 --- a/sys/dev/evdev/evdev_utils.c +++ b/sys/dev/evdev/evdev_utils.c @@ -147,7 +147,7 @@ static uint16_t evdev_at_set1_scancodes[] = { NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, - KEY_KATAKANAHIRAGANA, KEY_HANGEUL, KEY_HANJA, KEY_RO, + KEY_KATAKANAHIRAGANA, KEY_HANJA, KEY_HANGEUL, KEY_RO, NONE, NONE, KEY_ZENKAKUHANKAKU, KEY_HIRAGANA, KEY_KATAKANA, KEY_HENKAN, NONE, KEY_MUHENKAN, NONE, KEY_YEN, KEY_KPCOMMA, NONE,