Unix Programming - Re: Keyboard input at kernel level

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > June 2004 > Re: Keyboard input at kernel level





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Keyboard input at kernel level
Janos Makadi

2004-06-26, 10:10 am

Ulrich Eckhardt wrote:
> Generally, that's a bad idea to have UI in several threads. You should
> rather make that thread send a message to the UI thread and ask it to pop
> up the alarm window.


You are absolutely right.

At first time, I started coding like that, but later I realized, ncurses
and CDK aren't thread safe. So if I want to handle keyboard input in
only one thread, I have to write my own UI, which able to use my input
schema. Or rewrite the parts in CDK which is relevant. (A little
explanation: The user do his job, fill forms etc. Event comes. A new
curses window must appear. This way it doesn't matter which thread puts
the new window to the screen, because the other thread which handles
forms, own's the stdin. Keyboard input goes to the form handling thread,
and the event window waits for infinity.) As I spend more and more time
to solve this problem, I guess the only way to write my own UI, and drop
CDK, but this is a big work. CDK has a lot good widgets, and I don't
want to rewrite it.

Thanks for your answer,

Regards,

Janos


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com