Need help on sending 5 consecutive USB keyboard LED on's.

Need help on sending 5 consecutive USB keyboard LED on's.

Post by Andrew Chu » Tue, 27 Dec 2005 11:20:05


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.yqcomputer.com/

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

1. Complete Newbie - Need a board that can send USB keyboard messages to a PC

2. Add-ons Dialog not shown (Tools, Manage Add-ons, Enable or Disable Add-ons/WIN XP)


Do a thorough check for malware, following all of the steps at one of these
Web pages.
Help with malware:
All MS-MVP Sites.
http://www.yqcomputer.com/
http://www.yqcomputer.com/
http://www.yqcomputer.com/ #Removing_Malware
http://www.yqcomputer.com/
http://www.yqcomputer.com/
http://www.yqcomputer.com/

Unexplained computer behavior may be caused by deceptive software.
http://www.yqcomputer.com/

So How Did I Get Infected Anyway?
For quite a few people it's by installing programs like Messenger Plus,
whose ads for malware don't identify the malware as such and try to convince
you that you owe it to the author. See also:
http://www.yqcomputer.com/
Don't ever do a "default" install of anything. Always choose Custom and see
what else is being carried along. Don't install any extras you're not sure
of.

--
Frank Saunders MS-MVP IE,OE/WM
www.fjsmjs.com
Do not reply with email

3. NEED HELP!!! With midi USB keyboard Midiman Radium

4. USB Addon Card, USB Keyboard and keyboard layouts

5. USB Keyboard LED

6. Non-USB keyboard w/USB adaptors - help

7. USB Keyboard / USB Barcode Scanner HELP!

8. [linux-usb-devel] 2.6.19-rc5-mm2 : usb keeps resetting usb keyboard.

9. Need help - need to flash a LED on PortA

10. Sending private data to a USB HID Keyboard

11. SQL Query Help: Need to remove consecutive items and just keep the earliest

12. need help on finding consecutive days .tks.

13. Need help to solve consecutive comma problem..

14. STILL NEED HELP COUNTING CONSECUTIVE RECORDS>=1