All of lore.kernel.org
 help / color / mirror / Atom feed
* Translate keysyms to ASCII
@ 2012-03-29 11:14 Gabriel Duarte
  2012-03-29 17:42 ` Jeff Haran
  0 siblings, 1 reply; 3+ messages in thread
From: Gabriel Duarte @ 2012-03-29 11:14 UTC (permalink / raw)
  To: kernelnewbies

Hello people,


I working on a small proof of concept keylogger that works on kernel mode.
It's parte of my studies of kernel development.
I'm using the struct "keyboard_notifier_param" to get the keys pressed on
the keyboard(s) attached to the system.

At the end, I print the value, like this:

printk(KERN_DEBUG "KEY== %i", param->value);


According to the definition of the struct "keyboard_notifier_param" at
http://lxr.free-electrons.com/source/include/linux/keyboard.h#L37, the
field value is a  "keycode, unicode value or keysym".

For example, when I press the key a, I get the value 30, but I would like
tranlate it to the ASCII. I managed to create a translation table by
myself, but I think there is another way more stylish to do this, or not? I
googled a lot but could not find a consistent answer.

Any help is appreciated,

Gabriel.

-- 
Gabriel Duarte
Linux User #471185
France / Grenoble - Rh?ne Alpes
http://genericdev.wordpress.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120329/8ae23171/attachment.html 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Translate keysyms to ASCII
  2012-03-29 11:14 Translate keysyms to ASCII Gabriel Duarte
@ 2012-03-29 17:42 ` Jeff Haran
  2012-03-30 22:03   ` Gabriel Duarte
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Haran @ 2012-03-29 17:42 UTC (permalink / raw)
  To: kernelnewbies

From: kernelnewbies-bounces@kernelnewbies.org [mailto:kernelnewbies-bounces at kernelnewbies.org] On Behalf Of Gabriel Duarte
Sent: Thursday, March 29, 2012 4:14 AM
To: kernelnewbies at kernelnewbies.org
Subject: Translate keysyms to ASCII

Hello people,


I working on a small proof of concept keylogger that works on kernel mode. It's parte of my studies of kernel development.?
I'm using the struct "keyboard_notifier_param" to get the keys pressed on the keyboard(s) attached to the system.

At the end, I print the value, like this:

printk(KERN_DEBUG "KEY== %i", param->value);


According to the definition of the struct "keyboard_notifier_param" at http://lxr.free-electrons.com/source/include/linux/keyboard.h#L37, the field value is a ?"keycode, unicode value or keysym".

For example, when I press the key a, I get the value 30, but I would like tranlate it to the ASCII. I managed to create a translation table by myself, but I think there is another way more stylish to do this, or not? I googled a lot but could not find a consistent answer.

Any help is appreciated,

Gabriel.

-- 
Gabriel Duarte
Linux User #471185
France / Grenoble - Rh?ne Alpes
http://genericdev.wordpress.com/

The term I think you want to search for is "PC keyboard scan code". This link seems to cover it pretty well:

http://www.quadibloc.com/comp/scan.htm

Jeff Haran

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Translate keysyms to ASCII
  2012-03-29 17:42 ` Jeff Haran
@ 2012-03-30 22:03   ` Gabriel Duarte
  0 siblings, 0 replies; 3+ messages in thread
From: Gabriel Duarte @ 2012-03-30 22:03 UTC (permalink / raw)
  To: kernelnewbies

Anyway, does not work...
I just would like to know if the kernel offers me a conversion table. As I
said, I did it already by myself, but was just looking for a more stylish
way to do...

On Thu, Mar 29, 2012 at 7:42 PM, Jeff Haran <jharan@bytemobile.com> wrote:

> From: kernelnewbies-bounces at kernelnewbies.org [mailto:
> kernelnewbies-bounces at kernelnewbies.org] On Behalf Of Gabriel Duarte
> Sent: Thursday, March 29, 2012 4:14 AM
> To: kernelnewbies at kernelnewbies.org
> Subject: Translate keysyms to ASCII
>
> Hello people,
>
>
> I working on a small proof of concept keylogger that works on kernel mode.
> It's parte of my studies of kernel development.
> I'm using the struct "keyboard_notifier_param" to get the keys pressed on
> the keyboard(s) attached to the system.
>
> At the end, I print the value, like this:
>
> printk(KERN_DEBUG "KEY== %i", param->value);
>
>
> According to the definition of the struct "keyboard_notifier_param" at
> http://lxr.free-electrons.com/source/include/linux/keyboard.h#L37, the
> field value is a  "keycode, unicode value or keysym".
>
> For example, when I press the key a, I get the value 30, but I would like
> tranlate it to the ASCII. I managed to create a translation table by
> myself, but I think there is another way more stylish to do this, or not? I
> googled a lot but could not find a consistent answer.
>
> Any help is appreciated,
>
> Gabriel.
>
> --
> Gabriel Duarte
> Linux User #471185
> France / Grenoble - Rh?ne Alpes
> http://genericdev.wordpress.com/
>
> The term I think you want to search for is "PC keyboard scan code". This
> link seems to cover it pretty well:
>
> http://www.quadibloc.com/comp/scan.htm
>
> Jeff Haran
>
>
>


-- 
Gabriel Duarte
Linux User #471185
France / Grenoble - Rh?ne Alpes
http://genericdev.wordpress.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120331/820fa146/attachment.html 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-30 22:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-29 11:14 Translate keysyms to ASCII Gabriel Duarte
2012-03-29 17:42 ` Jeff Haran
2012-03-30 22:03   ` Gabriel Duarte

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.