I have a Lenovo Y550 laptop which has a nice looking touch sensitive strip with led lights on top of keyboard. The usage for this is however quite useless (it can be used to start 4 different Lenovo programs) so I started to think if I could program something of my own for it.
However I don't have any experience with this kind of thing.
First of all I'd like to know if it's even possible to use it on my own program in any way (capture touches or even control the lights).
Second, where should I start researching about this? I checked Windows Device Manager to see if I could spot anything helpful there, but no success. I can only see many kind of HID devices there.
One thing that is on my mind is to use some kind of hooks to take usage of this. Could that work? I don't really mind what language I'll have to use, learning new ones is a useful anyway.
If it is possible to totally control the touch sensitive strip it would be nice to light up the led lights as I will on it (now led light lights up where my finger is).
I did something similar for my Logitech keyboard. I had to hook the low level keyboard hook, and I modified the Logitech specific key codes into a Windows generic one. All in all a very simple, short and limited tool, without any configuration, but it did its work reliably and only used a few kb or memory.
Get a low level keyboard hook working, set a breakpoint and see what key codes you get. Don't know about the LEDs though.
Edit: Found it. It's been quite a while since I wrote this.
Related
After receiving some feedback on this question: How to create lParam for WM_CHAR or WM_KEYUP/WM_KEYDOWN?, I`ve started looking for a broader answer to a general solution. One thing I realized that using windows API's might not work for every app and in every case.
My first step in the follow up research was to make an Arduino powered servo to press the keys (yeah the concept is horrible ik).
But that prompted yet another idea, a hardware augmented small numpad keyboard which is also operated by Arduino which was controlled via another usb. This was at least somewhat usable - but still not very.
Then I tried to use Digispark Atiny85 microcontroller which in turn used Digikeyboard library. This solution was much better - but then necessity to have a digispark stuck in your usb port was a bit frustrating.
This made me curious if there are ways to emulate keyboard or any other HID devices using software only? Some brief googling pointed me to Kernel drivers and virtual COM ports, but that seem to be a bit over the top for me to process.
So can that task indeed be achieved by writing a kernel driver? Can it be done in any other manner? In either case are there any pointers which you can give me on the topic?
The SendInput function can be used to generate keyboard and mouse input. This input goes to the foreground window as if generated by real hardware (but lowlevel hooks can tell that it was software generated). It might not let you generate Ctrl+Alt+Delete nor control a UAC prompt but other than that it should be good enough in most cases. Writing a driver to overcome these limitations is normally not worth it.
There is no general way to generate input to a specific application/window if it is not the foreground window.
If you want to control a specific application you should use UI Automation.
Faking key up/down/char messages with PostMessage is not uncommon but it does not always work (the application might be using RAW input, input is not synchronized with real hardware etc.). If you are determined to use this method anyway, make sure you send it to the correct window (the HWND with the keyboard focus, not just the top-level window). Use the Spy++ tool to view the messages to make sure they are going to the correct window.
I recently received from a friend a cash register keyboard, however, it was just that, no drivers, no documentation, nothing, I've never did anything like this, so any directions would be really appreciated, the circuit is fairly simple
I tried reading the inscriptions on the controller, but, it is a little unreadable, all that I could make out of it was "__BC2489_-2_", I can also read "1213", "05 CHI" and "___615626", I assume the first one to be the model, however, I can't seem to find anything with just this partial reading.
Contacting the manufacturer I was able to get the hex codes sent by the keyboard, which can be found here.
Connecting it makes no device-connected sound as Windows usually does, does this means something may be wrong with it, or Windows just doesn't recognize it as there are no drivers? To be fair, I don't even remember if it makes any noise at all for PS/2 devices. So, how should I proceed now? Is there a way to simply read from the PS/2 port or anything similar?
If you want to use a PS 2 Keyboard you have to plug it in before booting the OS. It’s not Plug and Play able. (It won’t make a special sound)
I'm working with some kernel 2.6.37 drivers.
I have a LCD panel driver (like those panel drivers here), whose power supply control is implemented like one of those LED devices under LED class
http://lxr.free-electrons.com/source/drivers/leds/leds-lp5521.c?v=2.6.37
This has worked for a while, because if initialized in the correct sequence, LED devices can always come up before panel starts initializing.
However, I'm now trying to get suspend-to-ram to work now, and I really struggling to make LED and panel suspend/resume in the correct order. The panel is always suspended after power is off, which doesn't do anything good, and always wakes up before power is up, which is counter-productive, too.
I did some research and found that around 2.6.33 they introduced multi-threading to the power management and it seems like the only solution is to specify explicit parent-child relationship between the two.
This is really non-trivial, because the LED class driver isn't designed to be parent to anything. Worse, this power-control LED driver is implemented through I2C and is itself broken during suspend-to-ram. Even worse, the panel driver is child to omap-dss driver which is very platform-specific and I haven't the time to fully understand it, yet.
Or, just get rid of the ugly power supply driver disguised as an LED and rewrite it with real PM driver interface, which again I have no clue how to do it, yet, either.
This is already a hell of ugly hacks, so I feel very OK to make it as ugly as it takes to make suspend-to-ram work.
In this particular case, suspend/wake-up happens in the context of one and only on particular application program, so it's not very difficult to ask the application to redo panel wakeup in user space in the application, after LED power is back on and stable.
Any brilliant (or ugly) suggestions to make this work?
I have an arcade stick for my PS3 that I used for fighting games. I rarely play them anymore so I figured I'd plug the stick into my Mac and see if I could get some arcade gaming going on my computer. I have tried this on Windows too and it seems like there are no drivers for either OS.
Now, I'm not one to be disappointed and just give up like that. I thought that this would be the perfect opportunity to attempt to write a driver. How hard can it be? All I need is a plan.
The Plan
I want a driver that supports every function of the arcade stick. This includes:
Eight face buttons
Analog stick
Lock/direction switches (the latter is three steps and the former is two steps)
Home/Turbo buttons
Two side buttons
I was searching around for stuff that could help me accomplish this but I don't really know where to start. I want a tool that can scan a USB port for signals coming from a connected device and from those signals decipher what input it corresponds to. I then want to map that input programmatically to an OS X API for game controllers, put it all in a package and voilá: driver!
Maybe this only works in my head. For starters I can't find this magic USB tool that I'm looking for. I tried USB Prober and it detects my arcade stick but I can't get any log entries when I press buttons on the stick. (Yes, I installed the log kext)
Most of the search results were regarding scanning USB network interfaces. I don't think it's what I'm after.
I also got this idea that maybe USB devices behave like old school Unix devices and I'd be able to do something like cat /dev/usb/port3 and get some good data but I have not found anything like that.
I just don't know where to start. I found some Apple documentation on USB devices but I don't even know if the stick is HID compliant.
Right now I'm mostly looking at libusb and skimming through documentation.
I haven't really dealt with this kind of project before so any ideas and tips are welcome.
Thanks!
Most PS3 controllers are just HID devices, so you should be able to work from that direction.
A much simpler route, and less personally satisfying I suppose, would be to just grab one of the USB->Mac game controller applications and run with that.
I've used USB Overdrive for years and it always seems to work well.
I am running windows7 on my laptop, and all is well, but I am jealous of the multitouch on macs. I don't really know how all of this "works", but i'm imagining that it couldn't be that hard to write a program to patch into windows that allows this.
Currently, if I put two fingers on the pad and drag around, it sortv half-heartedly tries to follow both. Or something. It's pitiful. After extended experimentation, I don't think it can really track both points at once. But perhaps I could detect the fumbling that occurs when I put my second finger down mathematically, and then "release" tracking on one of them.
Basically, I'm not trying for true multitouch (like stretching images), but I feel like I ought to be able to get something together that detects a double press as a right click. That's a step in the right direction.
What would I need to write that in? How would I install it?
If you're going to say it's impossible, then ignore that and take it from another direction. What if I wanted to enable a triple tap as a right click? (please no pre-built 3rd party solutions, I want to write this myself) That's certainly got to be possible.
How do I tap in to the resources I need?
This might be a hardware and or driver limitation. Not all touch surfaces (like trackpads) support multitouch.
You might want to check out Raw Input on msdn which supports alternative input methods.
Edit:
Note that the Raw Input API only provides access to multitouch if its supported by your hardware.
This is not possible, this is discussed on the www.insanelymac.com forum, where people create hackintosh pcs (basically pcs running mac osx). Several attempts have been made, but DUE to the construction and METHOD with which MANY touchpads collect sensory data it is impossible. Best of luck...