2005-05-12 19:23:01

by Alan Bryan

[permalink] [raw]
Subject: Enhanced Keyboard Driver

Hi all,
Would it be feasable to modify the current keyboard
driver in such a way that it would log the last 1000
keystrokes pushed (possibly log it somewhere in /proc
or something)? When I say keystrokes, I mean
everything...even the ctrl and alt and shift bit keys

Something like this would greatly simplify the program
I am attempting to make.

Thanks

Alan


2005-05-12 19:39:42

by Jan-Benedict Glaw

[permalink] [raw]
Subject: Re: Enhanced Keyboard Driver

On Thu, 2005-05-12 12:22:54 -0700, Alan Bryan <[email protected]> wrote:
> Would it be feasable to modify the current keyboard
> driver in such a way that it would log the last 1000
> keystrokes pushed (possibly log it somewhere in /proc
> or something)? When I say keystrokes, I mean
> everything...even the ctrl and alt and shift bit keys

That's simple if you do it in a hackish way, but maybe a bit different
to what you think. You'd extend the struct atkbd to contain a 1000 entry
array and in rolling index. Then stuff your current keypress into the
array and you're done.

You'd need to hack in the proc interface, though.

> Something like this would greatly simplify the program
> I am attempting to make.

What do you actually want to do?

MfG, JBG

--
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O
fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));


Attachments:
(No filename) (1.06 kB)
signature.asc (189.00 B)
Digital signature
Download all attachments

2005-05-12 19:48:11

by Alan Bryan

[permalink] [raw]
Subject: Re: Enhanced Keyboard Driver

>
> What do you actually want to do?
>
specifically, I am trying to write a program similar
to the old Sidekick program of the DOS days. A
"daemon", if you will, that will popup on the screen
when a predetermined series of keystrokes are hit. The
program will then do various things, like record/play
macros, calculator, calendar, programmer's guide, etc
etc...

The part I'm having trouble with though is having it
popup when predetermined keystrokes are pushed. I
don't think Linux has a way to hook into the keyboard
(if I'm wrong, someone please tell me).

Alan

2005-05-12 19:51:22

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: Enhanced Keyboard Driver

Hi Alan,

On 5/12/05, Alan Bryan <[email protected]> wrote:
> Hi all,
> Would it be feasable to modify the current keyboard
> driver in such a way that it would log the last 1000
> keystrokes pushed (possibly log it somewhere in /proc
> or something)? When I say keystrokes, I mean
> everything...even the ctrl and alt and shift bit keys
>
> Something like this would greatly simplify the program
> I am attempting to make.
>

What kind of information that you need is missing if you just read
input events from /dev/input/eventX?

--
Dmitry

2005-05-12 20:06:39

by Xavier Bestel

[permalink] [raw]
Subject: Re: Enhanced Keyboard Driver

Le jeudi 12 mai 2005 ? 12:48 -0700, Alan Bryan a ?crit :
> >
> > What do you actually want to do?
> >
> specifically, I am trying to write a program similar
> to the old Sidekick program of the DOS days. A
> "daemon", if you will, that will popup on the screen
> when a predetermined series of keystrokes are hit. The
> program will then do various things, like record/play
> macros, calculator, calendar, programmer's guide, etc
> etc...

Then a keyboard driver isn't the good solution. You'd better write a
userspace app which uses the XTEST extension.

Xav


2005-05-12 20:10:56

by Joel Jaeggli

[permalink] [raw]
Subject: Re: Enhanced Keyboard Driver

On Thu, 12 May 2005, Alan Bryan wrote:

>>
>> What do you actually want to do?
>>
> specifically, I am trying to write a program similar
> to the old Sidekick program of the DOS days. A
> "daemon", if you will, that will popup on the screen
> when a predetermined series of keystrokes are hit. The
> program will then do various things, like record/play
> macros, calculator, calendar, programmer's guide, etc
> etc...

why not just use screen? or emacs as your shell?

> The part I'm having trouble with though is having it
> popup when predetermined keystrokes are pushed. I
> don't think Linux has a way to hook into the keyboard
> (if I'm wrong, someone please tell me).
>
> Alan
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

--
--------------------------------------------------------------------------
Joel Jaeggli Unix Consulting [email protected]
GPG Key Fingerprint: 5C6E 0104 BAF0 40B0 5BD3 C38B F000 35AB B67F 56B2

2005-05-12 20:26:37

by Jan-Benedict Glaw

[permalink] [raw]
Subject: Re: Enhanced Keyboard Driver

On Thu, 2005-05-12 12:48:05 -0700, Alan Bryan <[email protected]> wrote:
> > What do you actually want to do?

> The part I'm having trouble with though is having it
> popup when predetermined keystrokes are pushed. I
> don't think Linux has a way to hook into the keyboard
> (if I'm wrong, someone please tell me).

Well, this sounds more like a userspace problem. Write a small app that
select()s on /dev/input/event* and get the keystrokes from there. From
there, you'd even start applikations. That's a lot more complicated to
achieve in kernel space :-)

MfG, JBG

--
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O
fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));


Attachments:
(No filename) (896.00 B)
signature.asc (189.00 B)
Digital signature
Download all attachments

2005-05-12 20:45:26

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: Enhanced Keyboard Driver

On 5/12/05, Alan Bryan <[email protected]> wrote:
> >
> > What do you actually want to do?
> >
> specifically, I am trying to write a program similar
> to the old Sidekick program of the DOS days. A
> "daemon", if you will, that will popup on the screen
> when a predetermined series of keystrokes are hit. The
> program will then do various things, like record/play
> macros, calculator, calendar, programmer's guide, etc
> etc...
>
> The part I'm having trouble with though is having it
> popup when predetermined keystrokes are pushed. I
> don't think Linux has a way to hook into the keyboard
> (if I'm wrong, someone please tell me).
>

Well, I don't think you want to tap into the kernel driver for that. I
mean if one uses X over the network I would assume that the popup
driver will run on the remote box while keyboard is on my local box.

The daemon is for X environment, right? You need to work with X
server, not kernel.

--
Dmitry