Just doing some advanced scouting so to speak here...
For my Pandora client, Elpis, I support global media keys (MediaPlayPause, MediaNext, etc. on the keyboard) and I want to be able to support AVRCP from bluetooth headphones if possible. I do not currently have any (though will try to get some soon).
My main question is, what events (keyboard or otherwise) are fired by AVRCP commands in windows?
Is it something that depends on the BT adapter and/or driver stack?
I would love it if they just were exposed as the same media keys mentioned above, but I can not find any official MS documentation confirming or denying that... But from what I can tell, WMP supports it but some other media players do not (though they support the standard media keys), which leads me to believe it is different events.
Any insight would be greatly appreciated.
There isn't a set of exposed events available for Bluetooth on Windows. Btd.dll contains this functionality and uses the PassThruOpId enum for play, stop, pause, FF and RW. Click here for the MSDN entry on this.
UPDATE As per the comment below I am unable to find any documentation other than that of the Compact Framework for this question.
UPDATE: Here is a link to the Windows Bluetooth Driver Stack. Also checkout this other stack question.
Don't know where its documented at MSDN...assuming it exists at all. But I have some other references:
http://download.microsoft.com/download/5/E/6/5E66B27B-988B-4F50-AF3A-C2FF1E62180F/CON-T564_WH08.pptx
Slide 10 -- "HF and AVRCP controls are mapped to Human Interface Device (HID) controls"
Slide 14 -- "AVRCP Controls are mapped to Human Interface Device (HID) API"
and table of mapping between AVRCP and HID values
IIRC it's also discussed by Larry Ostermann in this video: http://channel9.msdn.com/blogs/charles/inside-windows-7-larry-osterman-on-new-audio-capabilities At least Bluetooth phone Call control is discussed at 00:33:35 according to my notes.
Related
First of all, yes, i have read all other similar questions.
Secondly, i am developing app (WP 8.1 WinRT), which must use Beacons. I read a lot about it, and i know, that generally connection with BLE device is not possible without pairing it first. But hope dies last, so i want to ask about any possibilities I have. It is possible to pair devices in code (according to articles I have read - its not, but maybe someone know the way)? Or just obtain nearby Beacons Id or Name, or ANY information about them? All posts i have found are outdated (from last year, maybe MS or somebody released some update/api?) I search for any kind of solution, api or just idea how to avoid pairing problem. Pairing it manually won't work - 1. not sure if it is possible to pair beacons, 2. its too many of them (beacons I need)
I look for anyway to communicate or even obtain beacons.
I would be grateful for any option or idea
While I have not tried it yet, there a developer has built an HCI layer to talk directly to bluetooth dongles on pre-Windows 10 machines. It is available here: WinBeacon
This will only work on desktop machines, and not with mobile phones. If you are interested in mobile phones with Windows 8.x, I do not believe there is any solution. I have spoken with Microsoft engineers who have confirmed this to me.
The fundamental problem with Windows 8.x on mobile devices is that any Bluetooth LE scan operation (which is what must be done to search for beacons) must be initiated by the operating system. There is no public API and no known private API that can be used to initiate a Bluetooth LE scan. Pairing with the device will not help -- it is the scan that is important and iBeacon and similar BLE beacon types do not use pairing at all for their primary proximity detection purpose.
Microsoft engineers have told me there are no plans to add this feature to 8.x, as they want to push folks to Windows 10.
While I know this does not help for Windows 8.x, I will note for the record that for the upcoming Windows 10 release, we are working on a port of the Android Beacon Library to Windows here.
Is there any way to monitor microphone changes (plug in and plug out events)? Shouldn't matter if the mic is bluetooth / usb / or plugged directly to sound card.
Application is built with C# but if there isn't any good way to get the events using C# then C++/CLI might be also option.
I found also IMMNotificationClient from WASAPI which should work.
Seems NAudio is not exposing this, but after customization I'm able to use it and get plugin / plugout events. Although it doesn't seem really stable - duplicated events / missing events and etc. Is there any proper implementation example in managed level?
Interface description :: IMMNotificationClient interface
This link may help:
http://blogs.msdn.com/b/coding4fun/archive/2009/10/08/9905168.aspx
The post includes instructions on capturing the microphone level, etc.
Original post. Microphone Input
EDIT: Blog moved here: https://channel9.msdn.com/coding4fun/articles/NET-Voice-Recorder
I need to listen for keyboard events from a specific keyboard device & know which key is pressed in a (C#) WPF application. Ideally, this shouldn't be window dependant and work so long as the application has focus.
unfortunately I can't think of / find any way to do this.
any ideas?
D.R
Edit: I've been looking into the OpenTK.Input library, which has a nice interface for keys... Does anybody know how to get a KeyboardDevice without creating a GameWindow
Info: Just by the way, this is for a barcode scanner which emulates a keyboard... who's bright idea was that, eh?
I'm actually working on a project that does exactly that. Check out Kaptivate. It installs a global keyboard hook, and ties together (using magic) the raw input api, and then invokes a callback function so that YOU can decide (1) is this the device I'm after?, and (2) should I allow other apps to see it, or just keep the keystroke for myself. Right now it's only C++ but one of the goals is eventually to have C# wrappers.
For keyboards, each generated event tells you the vkey, scan code, and source device.
Have a look at the below 2 articles.
Using global keyboard hook (WH_KEYBOARD_LL) in WPF / C#
https://gist.github.com/471698
both should be exactly what you want...
Managed to find this tutorial on msdn. along with a Sample Scanner object which comes with the POS.Net SDK
I haven't really had the time to pick apart how it works yet to give a proper overview, but it seems I should be able to write a custom service object abstraction for any "keyboard wedge" HID device.
Suppose I have a touch screen which supports single finger touch, is it very hard to use software based solution (e.g. programming to detect multi-finger touch and movement) to make the touch screen support multi-touch?
Just like I bought a cheap single finger touch cell phone and through programming I make it work as iPhone, Gphone or what so ever cool (supporting multi-touch). :-)
I am using VSTS 2008 + C# + .Net 3.5. I am asking seriously, not joking. Please correct me if I am stupid and on a wrong direction.
It would likely depend upon what sort of information the driver for your device receives. If raw data from the touch panel is available, then you might be able to get some extra information and do some pseudo multi-touch.
My gut feeling, however, is that a single-touch interface will configure itself like a standard USB or PS/2 mouse. This would be done to simplify the driver interface - the manufacturer would be able to expose the hardware via already-established protocols.
If you have a device in mind you could always contact the manufacturer and ask them what sort of additional information they might be able to feed to you.
Touch isn't hugely "there" in .NET 3.5; but the good news is that I'm pretty sure it is much better supported in the 4.0 toolset (WPF 4.0 in particular, see here).
In 3.5, the only time I've personally seen good touch support is when I was using a "surface" device and the surface SDK; note that the surface SDK is not compatible with the regular touch API (although I think they've tried to bring the two together).
Oh, and I suspect you'll need windows 7.
I'm currently working on a project that utilizes a proprietary PCMCIA radio card to communicate with some wireless devices. I currently have a background process that handles reading data to and from the card and storing it for processing, but I'd like to be able to shut down power to the card when my application is not running. I've done some investigating, and while WMI evidently does support the CIM_PCMCIAController profile in its WIN32_PCMCIAController implementation, the SetPowerState() and Reset() functions are not implemented. Does anyone know of a way (with or without WMI) to control the power state of the slot? I need to be able to programatically both power off and power on either the slot or the card.
Edit
Several people I've spoken to have suggested adding a function to the card that would facilitate this. Unfortunately modifying the card to provide this sort of functionality really isn't an option right now.
Edit 2
I've confirmed that the device does show up in the Device Manager under the "Multifunction adapters" category, though neither disabling the device nor the PCMCIA controller itself from here has any effect on the power of the card.
Presumably, the device has it's own drivers of some sort and shows-up in Device Manager.
In which case, you could disable the device by calling devcon (Command-line equivalent of Device Manager), from inside your program. This would make windows handle shutting down the device.
devcon disable. See Example #31 for an example of how to shutdown device by a specific device id.
Am I going on the right-lines, or have I misinterpreted your question?
I'm curious, but does using the "Safely remove hardware..." button turn off the power to the device, enough to satisfy your requirement?
If that works, you could programatically register and unregister the device through Microsoft's API. Here is a page that shows a couple functions that might be helpful for this scenario: http://msdn.microsoft.com/en-us/library/aa363234(VS.85).aspx