The Linux keyboard driver
Use loadkeys to change the code produced by the BackSpace key from Delete to BackSpace:
% loadkeys keycode 14 = BackSpace
Assign the string “emacs\n” to the function key F12, and “rm *~\n” to Shift-F12 (the keycode 88 was found using showkey; the F66 is a random unused function key symbol):
% loadkeys keycode 88 = F12 shift keycode 88 = F66 string F12 = "emacs\n" string F66 = "rm *~\n"
Create the compose combination that will compose | and S into $:
% loadkeys compose '|' 'S' to '$' compose 'S' '|' to '$'
Reset to some default state:
% loadkeys -d
After the above handling, the obtained character(s) are put in the raw tty queue. Depending on the mode of the tty, they will be processed and transferred to the cooked tty queue. (Don't confuse raw mode as stty knows it, with the raw scancode mode discussed above.) Finally, the application will get them when it does getchar();.
Andries Brouwer, aeb@cwi.nl, has used Unix for various mathematical, linguistic, and playful purposes the past 20 years or so. He might be known to some for the first net release of hack.
- « first
- ‹ previous
- 1
- 2
- 3
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- A Topic for Discussion - Open Source Feature-Richness?
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Readers' Choice Awards
- Home, My Backup Data Center
- What's the tweeting protocol?
- New Products
- RSS Feeds
- One Hand Slapping
- Reply to comment | Linux Journal
7 hours 42 sec ago - Reply to comment | Linux Journal
9 hours 33 min ago - Reply to comment | Linux Journal
10 hours 50 min ago - great post
11 hours 25 min ago - Google Docs
11 hours 47 min ago - Reply to comment | Linux Journal
16 hours 36 min ago - Reply to comment | Linux Journal
17 hours 23 min ago - Web Hosting IQ
18 hours 56 min ago - Thanks for taking the time to
20 hours 33 min ago - Linux is good
22 hours 31 min ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.




Comments
how to test power and ptt keys??
Hai i want to test power and ptt keys. I am using evtest to test my keys on the keypad. But my driver wont generate any interrupt for power and ptt keys so how to test these keys??
general awareness
general awareness
Getting keyboard scancodes
The article is confused.
Please write a simple non-blocking function.
This can be the prototype:
bool keypressed( int& scancode );
bye
miro
linux keypad driver
the scancode related information are good
Re : Kernel Korner: The Linux keyboard driver
Good One !! But really missing the source code as example.
Re: Kernel Korner: The Linux keyboard driver
It's better to explain with a practical keyboard source code.
Re: Kernel Korner: The Linux keyboard driver
can u pls send the c code for keyboard device driver
need c code of keyboard driver
i will be greatful if someone help me. i need c code fo generic keyboard driver.
Can you please send me
Can you please send me source code of a generic keyboard driver?
Need it for Windows/Dos environment
Hi
I need to access certain keys on a Pentuim PC keyboard using ISO. But ISO just specifies the H and no C files and it only gives you the CRT device not the keyboard-subdevice of the CRT.
So I've decided to do a search for keyboard-drivers. And now I want the complete c code for a keyboard driver, please?
Re: Kernel Korner: The Linux keyboard driver
not a practical example... too confuse
Yes you are right
Linux needs to simplify everything so that our grandparents can use the system easily. I bet my grandparents would prefer Microsoft keyboard like http://www.compkeyboard.com/archives/microsoft-natural-ergonomic-keyboar...
than a Linux system with 4 pages of tutorial on keyboard
Dude, your an idiot. Your
Dude, your an idiot. Your grandparents are very unlikely to be writing keyboard drivers for Linux or Windows.
Grandparents
Oh, yeah? Well, my grandparents are awesome like that: 'Cept they write drivers for *nix only!
key state
getchar() is a blocking call and when you press a button the corresponding character is output to the terminal. Would if all I wanted was the state of any given key at any given time? Doing this on PS2 Linux is quite easy with the js0 device for composing a bit-feild containing the state of each controller button this frame. Is their a non-blocking, non-printing way to obtain the key state of any given key?
Source code for keyboard.c in on your computer
If you install the kernel source code you can find the source
code in /usr/src/linux/drivers/char/keyboard.c