Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello everybody,
This is not really a question. Rather, I want to share with you my quest for understanding how the character input travels from the physical keyboard to the software waiting for input. I emphasise on the text editor emacs.
Comments, corrections and suggestions are welcome.
Last edited by cristian.barbarosie; 02-02-2017 at 08:50 AM.
Reason: tiny typo
Nice, seems that you glossed over the hardware aspect with this line "When a human presses a key, some codes are sent to the linux kernel, of which the console driver is a part." The article is interesting though - good job.
You can gain some understanding of the logic device, clock and ASCII with an explanation like this:
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h> /* for sleep() */
#include <curses.h>
int main(void) {
WINDOW * mainwin;
/* Initialize ncurses */
if ( (mainwin = initscr()) == NULL ) {
fprintf(stderr, "Error initialising ncurses.\n");
exit(EXIT_FAILURE);
}
/* Display "Hello, world!" in the centre of the
screen, call refresh() to show our changes, and
sleep() for a few seconds to get the full screen effect */
mvaddstr(1, 33, "Hello, world!");
mvaddstr(2, 33, "Press Key!");
refresh();
int kepr = getch();
mvaddstr(5, 33, "Key Pressed: %d", kepr );
getch();
/* Clean up after ourselves */
delwin(mainwin);
endwin();
refresh();
return EXIT_SUCCESS;
}
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.