From nobody Tue Jul 19 22:08:21 2022 X-Original-To: dev-commits-src-all@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 4LnXys48xNz4X9k6; Tue, 19 Jul 2022 22:08:21 +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 4LnXys3fgpz3LbT; Tue, 19 Jul 2022 22:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658268501; 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=eTEHSaI1VSc5xWCK6mgh7zh75UXQQH5E9RFAphiqeK8=; b=i5ZEX8wKGjUty+fd+roACZX+eDK0SkUcKXjQF7sXBwfPLlIuddyRkp0VadRgIqRXAiYHXX 2pQGruQ3y3IVqLbt/hffg/hUiTYATIZuIryIw2UDv5tgqQhZmMsTvrD1TYyrne+KY6oHjz OzCvQ2T+OdqtZct9ql4U+Nh1WhTs0h21+WzO+bwxXJMDVDEDaLzvmPEWoAI+0fYpc40m2t W3Doh+FhM1lf8lBbOdRfKo2+ffO0pEv7nUzwZhufrsUM9YvPHrlS73QQgNEefzkhEhF1eT aeBopFG92mssUzEsrFuFR9BiDgDqI1CacsnFAbkbmTUo34xcuZNw1a/isogDfQ== 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 4LnXys2Y7qzZtc; Tue, 19 Jul 2022 22:08:21 +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 26JM8LR7003081; Tue, 19 Jul 2022 22:08:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26JM8LHo003080; Tue, 19 Jul 2022 22:08:21 GMT (envelope-from git) Date: Tue, 19 Jul 2022 22:08:21 GMT Message-Id: <202207192208.26JM8LHo003080@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 6a26c99f827f - main - atkbd(4): Fix "hancha" and "han/yong" korean keys handling. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 6a26c99f827ffa9da5e23d466eeb17131fc75238 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658268501; 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=eTEHSaI1VSc5xWCK6mgh7zh75UXQQH5E9RFAphiqeK8=; b=GV5W4Gid+gF9Fj0ExCyfPONtuUpweJHcmHW6yj7ZPwLtn8n4sEKtA2LWTCwgWdVYt8tpGu cimBcXw5BzdncUuczUpFBTBErqP0utcA2/W7y8VmaR1omR3f1uO+CI4Wyjqguq/5EvyRtM OuB480YMnTIVDvbqIR3VlAnvW1fvEVrPknD7N2mrdZhjLNOFpdX1tvc0q5/DtShLQ5b01v ranQ1fIAiRKY2tPB8FgyBr5vtM7VB9ZQVahMOdJlig1VTqGxDpSrHqULRl1S6WWkEbegsE 01uR+jo3LjEQI5FU6qUeoKznttpQjoRLFtk09PicitquWdnrkOapkrrHoqyg1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658268501; a=rsa-sha256; cv=none; b=KvGw80cRNnzzbcE0ZLriNCBeJRKgUQwudhRAXePcceJXCfn9XTBWvFcj/I0TXeneygPYY7 RIhTwiJ94q8U0OMKryZU9tLyA0bWqOcYmRsX/RLXMH5lIEkWVS8gCF9/olV7wz73eVzhnV 9z8W004AkeieVVTg1Ligdgo01N8rLgWMAZO7k1l6ADLAWU0PIIau0joh1Jpo6JAYQJh5NW B4o7KM2ByySNTvECOH4KDVKLKNqhuy3XK7jNIjEHQ+SCn60tC7NgrJZJK4tOBNlHU/j3k+ cN/W57n2dd+zbQHBWpp23z2YQDu+VpyKPTODoGqX39TSCFzlXHjPebcMGS2vnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=6a26c99f827ffa9da5e23d466eeb17131fc75238 commit 6a26c99f827ffa9da5e23d466eeb17131fc75238 Author: Vladimir Kondratyev AuthorDate: 2022-07-19 21:06:22 +0000 Commit: Vladimir Kondratyev CommitDate: 2022-07-19 21:36:20 +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. Reported by: Warioburn PR: 265260 MFC after: 1 week --- 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 e87e5591150c..3e261115527b 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,