Using the Input Subsystem, Part II
Three additional ioctl functions may be used for controlling force-feedback devices: EVIOCSFF, EVIOCRMFF and EVIOCGEFFECT. These functions currently send a force-feedback effect, remove a force-feedback effect and determine how many simultaneous effects can be used, respectively. Because the force-feedback support is still emerging and substantial work remains to be done, it is a little premature to fully document the API. The web sites listed in the Resources section of this article may have updated information by the time you read this.
email: bhards@bigpond.net.au
Brad Hards is the technical director for Sigma Bravo, a small professional services company in Canberra, Australia. In addition to Linux, his technical focus includes aircraft system integration and certification, GPS and electronic warfare. Comments on this article may be sent to bradh@frogmouth.net.
- « first
- ‹ previous
- 1
- 2
- 3
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
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
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| 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 |
- Linux Systems Administrator
- New Products
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Have you tried Boxen? It's a
4 hours 30 min ago - seo services in india
9 hours 2 min ago - For KDE install kio-mtp
9 hours 3 min ago - Evernote is much more...
11 hours 3 min ago - Reply to comment | Linux Journal
19 hours 48 min ago - Dynamic DNS
20 hours 22 min ago - Reply to comment | Linux Journal
21 hours 21 min ago - Reply to comment | Linux Journal
22 hours 11 min ago - Not free anymore
1 day 2 hours ago - Great
1 day 6 hours ago




Comments
Full example source.
I am making a full source code basic tutorial for copy pasting should be done in a few days I'll post the link. It will also include handling a joystick.
A forward note in the 2.6 version of kernel you need root permissions to open event# files. So you need to run under sudo or make a dev rule.
Best Way to Detect Hotplug from App
To Solusrex: I have the same issue. I see at
that the kernel should call /sbin/hotplug which calls device-specific scripts to handle the add or remove event. I'm going to try to instrument the associated script to somehow send a message to my app to notify it. You might try the same.
E Franz
Seriously, how hard is it to give useful code examples?
WHY would you not include the entire code fragment in each example? WHY are you obfuscating some parameter types? Example: you describe getting the unique identifier of a device using the EVIOCGUNIQ ioctl. But you reference a magical variable called 'uniq' the type of which you do not define anywhere. Exactly how is hiding this information supposed to be useful? Who edited this? Why are you trying to make my life more difficult? WTF?!?!
What is the best way to
What is the best way to detect from an app that a USB input device was plugged/unplugged beside polling it using open() function?
Hello, you can write a small
Hello,
you can write a small app that is called from a udev rule.
(You have to add a small rule for this)
Inside of the app you can broadcast a small message on a local socket.
Every app that listens on this socket, receive this notification.
bye
Uwe
Retrieve Scan Infor
Hi all...
I need to retrieve all data (position x,y) from the driver when i try to draw something on the pad tablet....
can anyone tell me how to get the ABS when i got event scan ??
bad code
The author clearly does not understand the beauty of copy and paste. Each listing of code just will never compile because the variables are not defined. People have to pull their hair to figure it out.
HELP: Retrieving Input from a Device
Hi All,
In one of my project, I need to retrieve events from keyboard in Linux environment. For doing that in my code firstly I opened /dev/input/event0 file and it was successfully opened. However, when I was trying to read something from that file. The read() function stuck and my program can't execute any further steps. Does anybody know why this kind of problem that I encounter and how can I solve this problem. Here is my code:
P.S: In order to execute program you need to be super user and then need to execute code. Otherwise, program will can give "File can not open" error.
#define FILE_PATH "/dev/input/event0" int main() { printf("Starting KeyEvent Module\n"); //int file, version; size_t file; const char *str = FILE_PATH; printf("File Path: %s\n", str); if((file = open(str, O_RDWR)) < 0) { printf("ERROR:File can not open\n"); exit(0); } struct input_event event[64]; size_t reader; reader = read(file, &event, sizeof(struct input_event) * 64); printf("DO NOT COME HERE...\n"); close(file); return 0; }change this : reader =
change this :
reader = read(file, &event, sizeof(struct input_event) * 64);
to
reader = read(file, event, sizeof(struct input_event) * 64);
You need one more flag
change this:
if((file = open(str, O_RDWR)) < 0)
to
if((file = open(str, O_RDWR|O_NDELAY)) < 0)
and check manual by 'man 2 open'
nice to see, but how many users have figured how to get a joysti
I for one can figure out how /etc/devfsd.conf needs to be edited to setup /dev/joysticks, or /dev/js* with nothing under /dev/input being created either.
linux/Doc*/devices says digital joysticks are char-15,128 while the help doc under makeconfig states char 13:0+ - /dev/input/jsX
neither of this help me much.
If there was documentation somewhere in the world about how to setup joysticks we could hopefully have more people using this code :)