Hi,

this question is mainly aimed at Jiri Svoboda as he is the author of most
of the keyboard
input code in HelenOS, but if anybody has any pointers for me, I'd
appreciate your input.

While working on the C++ io system, I was testing this code:

std::string str{};
while (std::cin >> str)
    std::cout << str << std::endl;

This is a common way to implement a cat-like behavior as the while loop
runs until
(in most cases) std::cin encounters EOF. However, the current HelenOS does
not provide
me with a way to send EOF to the standard input and so this program would
loop endlessly.

Because of this, I tried to make CTRL+D to send EOF to the standard input
by modifying
the term_read function in uspace/lib/gui/terminal.c . The problem is, both
the LCTRL and RCTRL
(and LALT/RALT for that matter) do not make their way to this function
(while others like
LSHIFT/RSHIFT or NUM_LOCK do). After checking the code of both the termnal
and the
HID server (which does actually set the CTRL flag) I cannot see where the
CTRL flag could be
cleared. Got any ideas (even general ideas for where I should look)?

The part of actually inserting EOF on a key combination is easy (currently
have it mapped
to LSHIFT + NUM1 for testing), it's just the dissappearance of CTRL that
confuses me :)

​dzejrou
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to