* uinput problem
@ 2008-05-16 16:20 Tobias Müller
2008-05-19 15:58 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Tobias Müller @ 2008-05-16 16:20 UTC (permalink / raw)
To: linux-input
[-- Attachment #1: Type: text/plain, Size: 1076 bytes --]
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.
I can't see what I'm doing wrong and hope someone might help me.
Regards
Tobias
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3389 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: uinput problem
2008-05-16 16:20 uinput problem Tobias Müller
@ 2008-05-19 15:58 ` Dmitry Torokhov
2008-05-19 16:38 ` Tobias Müller
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2008-05-19 15:58 UTC (permalink / raw)
To: Tobias M??ller; +Cc: linux-input
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: uinput problem
2008-05-19 15:58 ` Dmitry Torokhov
@ 2008-05-19 16:38 ` Tobias Müller
2008-05-19 17:20 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Tobias Müller @ 2008-05-19 16:38 UTC (permalink / raw)
To: Dmitry Torokhov, linux-input
[-- Attachment #1: Type: text/plain, Size: 976 bytes --]
Hi Dmitry!
Dmitry Torokhov wrote:
> Are you working in the console or in X?
In X. I tried it in the console and it seems to work. Problem occurs only within X.
> What keyboard driver are you using?
In xorg.conf is
Driver "keyboard"
set.
> You may want to send EV_SYN/SYN_REPORT calls in between
> keypress events since consumers might rely on them.
I added a function
void SysSync(int fd) {
struct input_event ev;
memset (&ev, 0, sizeof(ev));
ev.type=EV_SYN; ev.code=SYN_REPORT; ev.value=0;
write (fd, &ev, sizeof(ev));
}
and then tried
SysKeypress (uinput_fd, KEY_LEFTSHIFT, 1);
SysSync(uinput_fd);
SysKeypress (uinput_fd, KEY_1, 1);
SysSync(uinput_fd);
SysKeypress (uinput_fd, KEY_1, 0);
SysSync(uinput_fd);
SysKeypress (uinput_fd, KEY_LEFTSHIFT, 0);
SysSync(uinput_fd);
SysKeypress (uinput_fd, KEY_1, 1);
SysSync(uinput_fd);
SysKeypress (uinput_fd, KEY_1, 0);
SysSync(uinput_fd);
but same behaviour within X.
Regards
Tobias
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3389 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: uinput problem
2008-05-19 16:38 ` Tobias Müller
@ 2008-05-19 17:20 ` Dmitry Torokhov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2008-05-19 17:20 UTC (permalink / raw)
To: Tobias M??ller; +Cc: linux-input
On Mon, May 19, 2008 at 06:38:55PM +0200, Tobias M??ller wrote:
> Hi Dmitry!
>
> Dmitry Torokhov wrote:
>> Are you working in the console or in X?
> In X. I tried it in the console and it seems to work. Problem occurs only within X.
>
In this case I would recommend contacting X guys. You see that your
uinput program works and the in-kernel consode driver works as well.
Does xev reports the events you expect?
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-05-19 17:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-16 16:20 uinput problem Tobias Müller
2008-05-19 15:58 ` Dmitry Torokhov
2008-05-19 16:38 ` Tobias Müller
2008-05-19 17:20 ` Dmitry Torokhov
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).