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.
Related
I am currently writing a program where I wish to use a barcode scanner to scan a bar code into a system, then use this information to make certain decisions.
How can I get C# to react when I use the bar code scanner? Do I need certain DLLs or APIs to use a bar code reader? I can create bar codes but need a way for C# to read them externally and import them into the program.
Richard,
It is important to know that typically barcode scanners support multiple interfaces that fall into two categories. Many have an option that makes the barcode scanner appear as a keyboard and whenever you scan data the text is entered into your application at the insertion point. The manufacturer of the scanner may refer to this as Keyboard, Keyboard Wedge, HID Keyboard or simply HID mode, however the last one in this list is technically not accurate as there are other HID interfaces besides keyboard.
The second category is often referred to as application mode. There are several different interfaces that support application mode, such as IBM Scanner, HID POS Scanner, etc. Each of these interfaces represent follow a specific hardware specification. You must make sure that the mode that your scanner is in matches the SDK that you are using to interact with the scanner.
If you are using .NET Framework, you may find POS for .NET useful as it abstracts the barcodes scanner away from the software in a way that allows you to use scanners from multiple manufacturers without changes in your application. In this case, you will need to acquire an OPOS Service Object from the scanner manufacturer to use with POS for .NET. See POS for .NET 1.14.1 Download page for more information: https://www.microsoft.com/en-us/download/details.aspx?id=55758
Terry Warwick
Microsoft
As far as it is connected to your device correctly , it will automatically pass data to your Focused itembox in your program.so if you run your program.exe which has a textbox, when you scan a barcode , it will be parsed into that textbox (it has to be focused).
Use the class SerialPort. It can listen your ports and then when you will use your scan the program will read it.
while (spPort.BytesToRead > 0)
{
carac = (char)spPort.ReadByte();
if (carac != 08)
m_mystring += carac;
}
Here is an example of how you can read it. And this is the link to the class : https://msdn.microsoft.com/en-us/library/system.io.ports.serialport(v=vs.110).aspx
It also depends on what form your application takes. If you have the option of uploading a picture or accessing the camera, you can pull an image into your code and then use one of many SDK's to read the barcode out of the image.
I have just implemented this using a web application, and I used the ZXing SDK, which is a free port to .Net and is available via NuGet.
https://github.com/micjahn/ZXing.Net
If you're just starting out, samples within SDKs are the best place to get started.
UWP apps to handle barcode are best explained in the universal samples at --> https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/BarcodeScanner
A Win32 C# .net sample can be found in the Pos For .Net 1.14 SDK mentioned earlier.
Most barcode scanners are "HID" devices, which means that they write the data of the barcode (the small numbers) like you would do manually with your keyboard, they're also recognized as a keyboard by most operating systems.
So the easiest way is just having a textbox. Make sure the focus is automatically on the textbox before the scan, and if you want it to automatically do something, make sure to have an event listening for an enter keydown. (Most HID scanners press an enter right after the scan is complete.)
Barcode scanner has are sending keys when they detects Barcode same goes with QR Scanners.
All you need is just put the focus in a textbox and use some events like text change or keypress/keydown since most of the scanners has an option for you to add/remove newline at the end of each set of keys it returns.
Using a physical barcode scanner is one option, but you're limited to scanning one barcode at a time.
An alternative option would be passing multiple documents, either as images or PDFs, to your application to process in bulk.
IronBarcode is a c# barcode scanner that also allows you to read barcodes quickly and accurately in this way.
// The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs.
// All threads are automatically managed by IronBarCode.
var ListOfDocuments = new[] { "Image1.PNG", "image2.JPG", "image3.PDF" };
PagedBarcodeResult[] BatchResults =
BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments);
Disclaimer: I work for Iron Software.
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
I'm writing an app (in C#) which as a part of it must simulate and send some key strokes to another application. I'm using http://inputsimulator.codeplex.com/ project for simulating keys, and it works in many applications, but in some it doesn't - i.e. Mortal Combat 4.
I've googled about it, and found many answers varying from 'it's impossible' to 'you must use XXX library' etc. Those answered scared me a lot, and even nearly convinced I'm not able to do it at that time, BUT...
M$ Virtual Keyboard works. It works in ALL applications. So it IS possible... Does anyone of you, clever guys, know how can I achieve this?
Ok, I think I finally got it to work. I used API Monitor recommended by Neal P and it showed just minimal differences between OSK calls and mine. A bit later I've tried to make my calling thread sleep some time between sending messages with press and release key and that was it.
Although you were able to achieve your purpose, the way you achieved it does not fundamentally answer your question: How to simulate keyboard input in ALL applications?
There's a bunch of situations where the common user mode Microsoft API already mentioned does not work, like game applications that use the DirectInput API or protected games.
I have built a library that can help in this situations, it provides a simple C API that internally communicates with device filter drivers. It is able to send input for DirectInput based games and also is able to bypass some game protections. I have checked and it is still able to bypass some known game protections by using the x64 version of the library. Game protections commonly hook only the x86 system's api. Well, at last now, 18 February 2012, this is what I'm seeing happening.
Take a look at SendKeys on MSDN
I am planning to verify the user input for my application using the biometric input. I did some research on net and came up with following options of biometric input:
Fingerprint
Facial Recognition
Retinal Scan
Iris Scan
Voice Recognition
Signature Verification
Out of which I felt the fingerprint as most suitable options. But the problem with this is the API of the fingerprint device will vary with its hardware. So most probably I think I will need to code against the multiple devices API, which I don't find friendly.
I intend to do the programming stuffs in C#. Is there any way out of this. As I am new to this I'm clueless. What is the way to attack this problem and how vast is the project scope and what should be my approach for this project.
The problem is not unique to fingerprint readers, it will apply to all other options in your list and many other peripherals. In fact a standard API is the exception.
So you will have to look for somebody selling a library for this or writing your own (COM and/or Interop). And rolling your own will usually not be small or simple project.
Your program will have a list of supported devices, excluding the rest.
A colleague of mine was tasked with building a biometric based staff clock-in system for the company we both worked for. We, IT, choose Fingerprints as the biometric source. He researched and used this library from Bayometric - Griaule Fingerprint SDK along with some cheap MS print readers. From what he showed me and talked about at the time, does lead me to believe that this .net library had a nice API and was easy to work with.
The biometric system is still being used today, some 5 years later.
I work in the biometric field, and I use C# for a lot of the fingerprint stuff I do. My company had to develop a fingerprint device abstraction library for this very reason. Consider that all fingerprint scanners only REALLY need one call: getImage. Knowing this, my company wrote a library which initializes and sets up each device, creates a generic wrapper, assigns a unique ID, and throws it into a big list that you can enumerate over.
Then from the C# side all you have to do is "pick" a device (all you have to go on is a unique ID and maybe a manufacturer) and then use it. The image data that comes back has to be decided on in advance so that you know what you're going to get every time
The main problem with this approach is that a lot of devices these days have various gimmicks (e.g. programmable flashing lights), and by abstracting the devices away you lost the ability to access these special abilities. Furthermore, some devices actually return multiple channels of data (various spectrums of light for example) and you have to throw away all but one channel so that the application can remain device agnostic, which is a hard decision.
Finally keep this in mind: if you do minutiae extraction, the device you use unfortunately WILL impact which minutiae are detected. Some devices are "tuned" for certain algorithms, and so enrolling with device A and matching with device B may not work at all despite having picture-perfect fingerprints.
There is a similar question here: finger print reader for .net windows forms / WPF or silverlight client
Check the links in the answers
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.