linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Tobias M??ller <Tobias_Mueller@twam.info>
Cc: linux-input@vger.kernel.org
Subject: Re: uinput problem
Date: Mon, 19 May 2008 11:58:09 -0400	[thread overview]
Message-ID: <20080519115457.ZZRA012@mailhub.coreip.homeip.net> (raw)
In-Reply-To: <482DB441.7020205@twam.info>

Hi Tobias,

On Fri, May 16, 2008 at 06:20:17PM +0200, Tobias M??ller wrote:
> Hello everybody,
>
> I'm trying to write a small userspace program to receive keys via rs232 and sent the corresponding key events.
>
> Everything seems to work fine, except when I'm sending something like Aa oder aA where die keycode is the same. Then only AA or aa is recognized. I did't set the EV_REP bit because i don't need any auto-repeat features.
>
> I'm sending the events via the following function.
>
> void SysKeypress(int fd, int code, int down) {
> 	struct input_event ev;
> 	memset (&ev, 0, sizeof(ev));
> 	ev.type=EV_KEY; ev.code=code; ev.value=down;
> 	write (fd, &ev, sizeof(ev));
> }
>
> and if I hardcode an
>
> 	SysKeypress (uinput_fd, KEY_LEFTSHIFT, 1);
> 	SysKeypress (uinput_fd, KEY_1, 1);
> 	SysKeypress (uinput_fd, KEY_1, 0);
> 	SysKeypress (uinput_fd, KEY_LEFTSHIFT, 0);
>
> 	SysKeypress (uinput_fd, KEY_1, 1);
> 	SysKeypress (uinput_fd, KEY_1, 0);
>
> it only receices an !! and if I change the blocks an 11.
>
> I read the documentfile about input drivers, but i didn't find anything special about uinput.
>

Are you working in the console or in X? What keyboard driver are you
using? You may want to send EV_SYN/SYN_REPORT calls in between
keypress events since consumers might rely on them.

-- 
Dmitry

  reply	other threads:[~2008-05-19 15:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-16 16:20 uinput problem Tobias Müller
2008-05-19 15:58 ` Dmitry Torokhov [this message]
2008-05-19 16:38   ` Tobias Müller
2008-05-19 17:20     ` Dmitry Torokhov

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=20080519115457.ZZRA012@mailhub.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=Tobias_Mueller@twam.info \
    --cc=linux-input@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).