Windows 10 access keyboard light on laptop - c#

I recently purchased a lenovo t420 laptop. I upgraded it with an SSD and did the update from 7 to 10. I then installed a clean image of windows 10, without all the bloatware. I would like to have access to the keyboard light without installing the Lenovo software. It isnt a backlight but is a single white LED next to the camera above the display. I see it come on for a split second when I cold boot the machine, I'm assuming this is part of the POST test or similar boot process and as such I would think there would be some way for me to connect to it.
I have tried using the new Lamp class in the windows 10 UWP API, and that doesnt work. I also tried using the device enumeration method and that doesnt show anything that looks like the LED.
Here is the code I tried so far, condensed a bit.
Lamp lamp = await Lamp.GetDefaultAsync();
this reults in lamp = null
string selectorString = Lamp.GetDeviceSelector();
DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(selectorString);
this also results in null
this is the device enumeration code:
DeviceInformationCollection devices = devices = await light.EnumerateDevices();
This gives me about 291 different devices in the collection, none of which seem to match. I have held back on posting here as the list is long but can if requested.
Is there any way for me to access the LED through C#, if not C# than perhaps another language?
EDIT: I just found the keyboard key, I had bad info before, its Fn + Pgup. That works so i guess I dont need to write something myself but I am still curious as to why I cant find a hook to it.
As a learning exercise I would still like to know how to access the LED.

Ok, so I think this is as close as I am going to get to an answer and I would like to put it here for any future curious minds.
Here is a link to a page with a bunch of info on how to get at the ThinkLight from Linux and Windows.
http://www.thinkwiki.org/wiki/ThinkLight
And here is the important stuff in case the link breaks.
Controlling the ThinkLight with the keyboard works on all systems since it relies on the BIOS exclusively. Just press Fn+PageUp to toggle its state between on and off.
Starting with the ##30 series models (T430, T530, W530, etc), the keystroke was changed to Fn+Space in order to better accommodate the new 6-row keyboard layout. On models with backlit keyboards, there are 4 states: off, dim backlit, full backlit, and full backlit w/ ThinkLight. Models without backlit keyboards only have ThinkLight on and ThinkLight off, which can be obtained by disabling the backlit keyboard in the BIOS of models with backlit keyboards installed.
Software Control via thinkpad-acp
Software Control via thinkpad-acpi
Support for controlling the light with ACPI is provided by thinkpad-acpi. After installing it, a simple
# echo 255 > /sys/class/leds/tpacpi\:\:thinklight/brightness
switches it on and a
# echo 0 > /sys/class/leds/tpacpi\:\:thinklight/brightness
switches it off again.
This allows one to control the light in scripts. Unfortunately, no known ThinkPad comes with a light sensor (yet). ;)
To use these controls in scripts without root permissions, you should run
# chmod 666 /sys/class/leds/tpacpi\:\:thinklight/brightness, which is probably best done using udev.
Applications
led-notification: Pidgin plugin to use any LED to indicate new
messages. I've forked led-notification to support the ThinkLight via
thinkpad-acpi. The plugins below either weren't compatible with the
latest pidgin or didn't compile for me. The original author of
led-notification seems MIA. Another fork pidgin-led-notification to
write user defined strings (added to Gentoo/Linux)
gaim-thinklight: If you are using GAIM, the gaim-thinklight plugin
will enable you to use the ThinkLight as an indicator for new
messages. This depends on thinkpad-acpi.
gaim-lighthink: gaim-lightthink is an alternative to gaim-thinklight.
pidgin-blinklight:pidgin-blinklight is a replacement for
gaim-lighthink intended for use with Pidgin.
rocklight: rocklight is a xmms visualization plugin that makes the
ThinkLight flash to the beat of your music. The package also includes
a standalone stroboscope mode program.
thinkblinkd:[1] Thinkblinkd is a python daemon to control the
thinklight (and possibly other lights on your Thinkpad) it comes with
the daemon and a control script.
The script for theft alarm using HDAPS optionally flashes the
ThinkLight when the alarm is armed (disabled by default, to enable
set $use_light=1).
kopete-thinklight:[2] This plugin for kopete will enable the usage of
the thinklight as notifiaction for new messages. stupid little hack
to blink the ThinkLight: [3] A little C program that may be set SUID
so that you can use it from non-privileged programs that needs to do
a little notification.
thinkalert: [4] Another C program that may be set SUID to allow
non-privileged programs to manipulate the ThinkLight. Adds some
features over the "stupid little hack to blink the ThinkLight"
program.
thinklight-notification: This Evolution plugin notifies the user with
a blinking light whenever a new message has arrived.
ThinkBlink: blink.sh is an universal bash script making ThinkLight
blink. It can be used with any application.
Windows support
Likewise, controlling the ThinkLight with the keyboard works without any additional software. The Hotkey Features software from IBM/Lenovo adds OSD icons that appear when the light is turned on/off.
Software control via Hotkey Features
The Hotkey Features software exposes an interface that allows (among other things) to control the ThinkLight. See Python script for Windows to control ThinkPad features for more information

Related

WinCE device - change keyboard input method

We have a Casio DT-X8 scanners that we are using in our company. They run .NET Framework 3.5 and WindowsCE 5.0
I have developed an app for them to suit our needs. The keypad on those scanners is the old mobile phone style, so a number 2 would be the number 2 but also ABC and abc. You switch between modes using the F8 button on the scanner. We have textboxes in the application that requires either a text input or a number input. It is sometimes time consuming to switch between the modes using the F8.
My question is, is there a way to set the input method through the app? I am already using the core.dll file to set the correct date and time on the scanner, so is it also possible to do similar with the input method?
I have searched google and stackoverlow but couldn't find anything that relates to my question. Many problems were to do with controlling the language input, but not the actual input type.
I am not looking for a complete code as that I can do myself. I just need some directions as to what to look for and how to tackle it.
I think that this feature is specific for that device.
Windows CE provides a way to change the software keyboard (look for Software Input Panel or SIP in the documentation), but does not apply to HW keyboards.
Do you have any "companion" app that can do this? If you have you know, at least, that it's possible to do it in SW.
If the HW manufacturer provides his own SDK that would be the first place where I would check for such a feature.
You may also have a look at the keybd_gen API in CE, this can be used to generate an emulated pressure of the F8 key. But I'm not too confident that this will work, since the key may be managed inside the keybd driver or at a lever lower than the one affected by that API and, in any case, it may be tricky to keep track of the keyboard state if the user presses that key when not running your app.

Run function in app from ms band

So I've had a look around and I cant seem to find an answer anywhere so here goes. Is it possible with the MS Band SDK to run a function within my app when the user taps a button?
Currently (at the time of writing) there is no way for the user to directly interact with a tile-app and thus pass a response to the application installed on the phone*
Your options are (as I see it):
To use the sensors to define 'gestures'**
Guide the user to use Cortana to provide speech commands ***
*This might change, but due to the very little storage capacity on the band if this was added I would assume only very basic interaction such as yes/no/cancel dialogos etc. and simpler responses using the keyboard when/if it becomes available for third party tiles.
**There is currently a bug with background work so you might have to prevent the lock screen from locking while receiving and interpreting sensor data on the phone which will impact the battery on the phone. This is expected to be fixed soon.
*** Speech commands are well supported on Windows Phone but I'm unsure how well supported they are on iOS and Android

Mobile or PDA on which I can have IDE (integrated development environment) like Visual Studio, Net-beans

I just like to code when i travel,but i can't carry my laptop while travelling so i thought of a mobile in which i can create apps in C#, .NET or Java but for that i need an IDE,Compiler,etc.
Basically I am looking for a phone / mobile / PDA (far more handy than a net-book or a laptop) in which i can code the way i can do it normally in Visual Studio installed in a machine.
So are there any such devices ?
Let's take a look at what you need to overcome to get this to work.
1) oomph
Smart phones are designed to give you the ability to stay in touch, and have a rich experience on the move, but within the confines of a device that can be put in your pocket. Storage isn't really an issue these days, but processing power on small devices are. Sure we can run calendar, 3D games (though nowhere near the complexity of what you'll see on a fully-fledged operating system), fart-applications and plug-ins for you-tube so we can watch idiots break their ballsacks on railings, but there's a reason you don't see a fully-fledged rich-desktop application, or Grand Theft Auto IV on these devices. Oomph. Now bring in the Visual Studio development environment (and database server, if that is what you're application is doing), with potentially 100s of source files in your language of choice. Assuming we put a severly cut-down version of your IDE on to your pda, I hope you brought some spare batteries or the power-cord because you're going to need it.
2) input
It's probably not difficult to change your predictive text input to cover all the keywords of your chosen language so that you don't end up typing pubic instead of public. Once we've solved that we then need to go through the agonizing process of the fact that computer code contains a lot of symbols and identifiers, meaning we'd have to switch our input mode every other word or two to facilitate it:
for(int i(0); i < _vector.length(); i++)
Takes a few seconds on a keyboard. Probably about one train journey on your PDA. To solve this, we must assume the PDA has the facility for an external keyboard to prevent suicide.
3) display
Ok, we've solved our oomph problems with a power-chord and/or 50 batteries and we've plugged in our external keyboard. We're ready to code!! We'll have to adjust the font-size on the display so that we can get more than 20 lines of code (vertically) or 10 (horizontally). I enjoy my comfort when I code, so I don't want to be squinting at a small screen as I type on my plug-in keyboard. I'd have to prop it up against some books or something (so I don't have to hold the PDA and the keyboard). Now I can't see what i am doing. So, I need a bigger display.
4) Target code
What platform are you targeting? Remember the PDA is designed to run software for the PDA in question. You won't be able to write fully-fledged win32 applications on Windows Mobile 7. There are differences in the API. What if it's a web app you're developing? We're going to have to add a web server to the phone too, unless that is deployed elsewhere and we can rely on an internet connection to upload the changed files to.
Have we solved the problem? Did we get more oomph? A keyboard? A bigger display? Yes we did.
It's a laptop.
It's impractical, as Moo-Juice mentioned. However, you could try using online compilers that work through web browsers, such as Compilr.com. Perhaps this could work well enough through a mobile device's web browser. This way you could write snippets of code and verify that it compiles. Otherwise, you'll be stuck getting a netbook or laptop.
Use a VNC client or Remote Desktop client or something.
Obviously your experience will not be very good on a phone/PDA, but I also don't have an IDE installed on my laptop -- I just use remote desktop (and a wireless modem if I'm desperately bored and can't find wifi).

Want to know about the best framework available for my app

I am trying to design a new application which basically aims at providing biometric authentication services. What I want to do is that the app will present the user with an interface where the user can get his eye scanned for authentication. The most important feature I want to incorporate is that the user need not have a webcam, the app must be able to read the eye from the display device i.e. CRT or LCD screen itself.
I want info about the best framework available for this. Once successfully tested, I am planning to provide it as a webservice. Any one who will help me will get a royalty from my income.
I think you're want Microsofts new multi-eye monitors. This is a special version of Multi-Touch intended for eye validation, much like how Microsoft Surface is intended for surface finger interaction. For example, you can just lay an eye on the table, and the table can sense the eye is there and validate it, using blue-tooth or whatever. I saw a demo where this guy just shakes his eye near the table and it validated him. I was so cool. SDK's will be available for Retina, Iris, etc.
I know for a fact that there has not been a lot of work done in this area, but the potential is big. I wish you luck.
The best way to do this is to use (old) monitors with electron tubes (LCD screens are not suited for your purpose). By applying a rectifier for the electric current input, swapping the polarity of the cable set to the electron tube and focussing the electron ray to a radio button on your user interface where the user is required to stare at you can make sure that the ray hits directly his eye and is reflected back to a small canvas you need on your UI (users should look a bit cross-eyed for this purpose). The electron pressure paints the retina layout directly to the canvas and you can read it out as a simple bitmap. No special SDK required.
You might try Apple's new iEye. This fantastic, magical add-on to the iPad rests on the eye, and is operated via a single easy-to-use button at the bottom of the device. Unfortunately, it only works with the iPad, and the SDK is proprietary.
I don't get you.
How do you propose the image of the eye is collected without some kind of image capture device.
A bog standard 'display device' is an 'output device' as opposed to an 'input device' - this means there would be no signal.
Are you talking mobile phone apps, custom manufacture eye scanning devices, desktop pc's?
please elaborate.
aaah Patrick Karcher - has the correct answer. plus one for that - i should have been more prepared for coming to stackoverflow on april fool's day.
If you mean getting images from devices without using encoders and drivers, have a look at TWAIN (Technology Without Any Interface). and it's faq.
The most important feature I want to incorporate is that the user need not have a webcam, the app must be able to read the eye from the display device i.e. CRT or LCD screen itself.
are you sure it's possible with the current CRT and LCD technologies? i think you have to have a reading device.
more info from TWAIN.org:
The TWAIN initiative was originally launched in 1992 by leading industry vendors who recognized a need for a standard software protocol and applications programming interface (API) that regulates communication between software applications and imaging devices (the source of the data). TWAIN defines that standard. The three key elements in TWAIN are the application software, the Source Manager software and the Data Source software. The application uses the TWAIN toolkit which is shipped for free.
good lucks.
I know this is an April Fools, but... Actually, if you remove the condition about the fact that it must come from a CRT or LCD screen it might be possible to do it without image capture device attached to their computer.
Possibly using their facebook username and some red-eye photos of them (reflection of the flash off the back of the retina) + a lot of luck and R+D.
Authentication then might simply come from some way of proving that you are the person in the photo.

C# Getting/Setting BIOS Settings?

I work with a Dell XPS M1710. The laptop has lights in the lid, the side speakers, and the front speakers (3 sets of lights that can be individually adjusted) and a light under the mousepad. In the BIOS I can change the color of these lights, at least, each group. Also, I can turn a light on/off under the mousepad, I can't change it's color, just alternate if it's lit. The laptop came with a lot of software from Dell, but I've installed Windows 7 and lost all of their apps, including one that allowed me to change these light colors. Now that Dell's app is gone, I'm interested in making my own C# application to change the color of these 3 sets of lights (I don't particularly care to change the light under the mousepad, I like it off). How would I go about developing an app to retrieve and change these BIOS settings?
We released an SDK for the community:
http://www.dell.com/html/global/xps/lightfx/index.html
(I can say "we" because I worked on it!!)
Offers an extensive library of
functions for building custom effects
using the XPS M1710 LED lights.
Allows you to build custom effects
just by creating a text file with a
few simple XML tags -- even if you
are not an XML programmer.
Includes application programming interface
(API) functions that allow you to
program lighting effects directly
into applications.
Highlights
several sample effects to inspire you
to new heights of creativity.
From what I've been able to find, this hackery is done in SMBIOS.
Looks like this developer figured it out -- he's written a Python GUI on Linux.
I read the source, and he's hooking to dellLEDCtl in libsmbios to do the dirty work. Here's the source, if you can stomach it. The git repo that Dell provided to the community for this stuff is here.
I don't think you're going to get this done completely managed.

Categories