From: Andrew Chuah <hachuah@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Need help on sending 5 consecutive USB keyboard LED on's.
Date: Sun, 25 Dec 2005 18:09:19 -0800 [thread overview]
Message-ID: <e18c2fef0512251809s2ce834c9maf8d52b983246337@mail.gmail.com> (raw)
Hi,
I just bought an IPAC-VE from www.ultimarc.com. It is basically a USB
keyboard emulator and I can hook it up to my arcade joystick to play MAME.
Now, the problem is that there is no programming utility for it in Linux, so
I am taking a look at trying to make one. There was one written in 2002 at
http://www.zumbrovalley.net/ipacutil/ but it no longer works for kernel 2.6.
The problem is that the way the PC talks to the emulator is by sending
keyboard LED signals. The first handshake is done by PC sending 5 "all LED
on" codes, and the emulator replies by sending a "z". So, I downloaded the
source for ipacutil and ran it, but it didn't work. I looked through the
kernel source (I'm running 2.6.9), and it looked like Linux doesn't send 2
"on" events consecutively.
So, I made the following changes in drivers/input/input.c:
case EV_LED:
// if (code > LED_MAX || !test_bit(code, dev->ledbit) ||
!!test_bit(code, dev->led) == value) {
if (code > LED_MAX || !test_bit(code, dev->ledbit)) {
printk(KERN_WARNING "Failed to turn on LED in input.c");
return;
}
if (value == 1) {
printk(KERN_WARNING "Setting LED now in input.c");
set_bit(code, dev->led);
} else if (value == 0) {
printk(KERN_WARNING "Clearing LED now in input.c");
clear_bit(code, dev->led);
}
// change_bit(code, dev->led);
if (dev->event) dev->event(dev, type, code, value);
break;
Instead of change_bit, I used set_bit and clear_bit. I also changed
drivers/char/keyboard.c
void setledstate(struct kbd_struct *kbd, unsigned int led)
{
if (!(led & ~7)) {
ledioctl = led;
ledstate = 0xff; -- added this line
printk(KERN_WARNING "In setledstate: flushing ledstate");
kbd->ledmode = LED_SHOW_IOCTL;
} else {
printk(KERN_WARNING "In setledstate: in else");
kbd->ledmode = LED_SHOW_FLAGS;
}
set_leds();
}
After all this, I modprobe evbug, and I see that ipacutil is "sending"
5 all LED ons, according to the log messages. However, I still don't
get a response. Is there something else I'm missing??? Can someone who
is more knowledgable point me to how to send all LED ons 5 times?
thx,
andrew
reply other threads:[~2005-12-26 2:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e18c2fef0512251809s2ce834c9maf8d52b983246337@mail.gmail.com \
--to=hachuah@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®