From: Karl Dahlke <eklhad@comcast.net>
To: linux-kernel@vger.kernel.org
Cc: dmitry.torokhov@gmail.com
Subject: [PATCH] put ledstate in the keyboard notifier
Date: Tue, 19 Feb 2008 15:53:15 -0500 [thread overview]
Message-ID: <20080119155315.eklhad@comcast.net> (raw)
I think there is general agreement, including myself,
that led state should be part of the key event, like shiftstate,
and not grabbed asynchronously after the fact.
So here is the patch that would do this.
I tested it with my keyboard modules and it works.
It only changes a couple lines of code, and will really help.
Thanks.
--- include/linux/keyboard.h 2008-02-19 14:56:02.000000000 -0500
+++ include/linux/keyboard.h.new 2008-02-19 14:55:50.000000000 -0500
@@ -33,6 +33,7 @@ struct keyboard_notifier_param {
struct vc_data *vc; /* VC on which the keyboard press was done */
int down; /* Pressure of the key? */
int shift; /* Current shift mask */
+ int ledstate; /* Current led state */
unsigned int value; /* keycode, unicode value or keysym */
};
--- drivers/char/keyboard.c 2008-02-18 21:05:23.000000000 -0500
+++ drivers/char/keyboard.c.new 2008-02-19 15:00:58.000000000 -0500
@@ -1238,6 +1238,7 @@ static void kbd_keycode(unsigned int key
}
param.shift = shift_final = (shift_state | kbd->slockstate) ^ kbd->lockstate;
+ param.ledstate = getledstate();
key_map = key_maps[shift_final];
if (atomic_notifier_call_chain(&keyboard_notifier_list, KBD_KEYCODE, ¶m) == NOTIFY_STOP || !key_map) {
reply other threads:[~2008-02-19 20:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080119155315.eklhad@comcast.net \
--to=eklhad@comcast.net \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.