Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
My question behave to my children age, when I got a new game to play, and was very impressed.
The game was able to see and react to more than 4,6 sometimes 8 keys pressed at same time. How is this possible? There is a limit for this? Or if I press "a,s,d,f,u,v,shift,0,uparrow,rightcltr,return and backspace" all thogheter, a program can "read it"? Some introduction about it (in C, bashscript, javascript, or phyton) will be highly appreciated. Thanks for any effort here.
If we are speaking about Windows, GetKeyboardState() copies the status of the 256 virtual keys to the specified buffer.
BYTE keys[256];
if(GetKeyboardState(keys))
{
//check if A key is pressed
if((keys[VK_A]&0xF0) && !(prevKeys[VK_A]&0xF0))
{
DoAPressed();
}
//check if S key is pressed too
if((keys[VK_S]&0xF0) && !(prevKeys[VK_S]&0xF0))
{
DoSPressed();
}
// the same goes for all keys you want to check
}
You can certainly react to multiple simultaneous keypresses by tracking events that occur when keys are pressed down and separate events that occur when keys are released. For example, in X11 these events are KeyPress and KeyRelease, and in web browsers they are KeyDown and KeyUp Javascript events. But I think you will find that most keyboards have a physical limitation on how many keypresses can be electrically detected at the same time, so your example "a,s,d,f,u,v,shift,0,uparrow,rightcltr,return and backspace" might be too many keys.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to make my Atmega robot to operate multiple modes (line following, obstacle avoidance, direct guidance from PC ) How can I load these separated programs on flash and how to select one of them when restarting the robot?
The easiest way is to make one big program with all the functionality of all the modes. On startup, in main() check if certain buttons are pressed, then choose which mode you are going to operate in. Then only use the functions and control mechanisms for that mode from then on. The rest of the code just sits there unused, but it would anyway in any other scheme.
There isn't an easy way to break the code into several different complete programs. For example, the vector table is fixed to be where it is. You would have to have the interrupt handlers check to see which mode is active then call the appropriate function for that mode.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am trying to simulate some clicking on a flash control on a window belonging to another executable using the AutoIT COM Object.
Since it is a long-running script I'd like to keep the system usable by normal (read: physical) means meanwhile. I first taught of a virtual machine, then I remembered that WndProc hooking exists.
Now I'd like to simulate clicks with fake WM_* messages instead of using AutoIt because it hijacks the mouse, in order to be able to run the automation in background without the mouse moving by itself and my current active window (i.e. notepad) losing focus.
My problem is that I have no idea on how to achieve the WndProc hooking in Vb.Net. People says a Dll injection is needed but in my previous Realbasic experience I did it in plain win api.
(To write messages I don't know, but to read worked.)
Ps. I've checked and no similar question seems to address this (at least in vb.net).
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
My teenage step-daughter is autistic, and tends to want to run away from school, leisure-club and sometimes even from home. This is very bad for her safety, and a great concern for us.
I am looking for a way to track her, so we can find her again when she runs away.
Here is my ideal (possibly unrealistic) scenario:
Tiny GPS device with GSM/GPRS
Can be woken up via sms when needed (so battery will last longer)
When activated, spins up GPS + Data connection and starts hitting a predefined URL with device ID and long+lat every 15 seconds
Battery life 7 days on standby (ie. when never activated)
Can be disabled put back to sleep via sms
I have googled and researched this for a while, but have yet to find a device that fits these requirements.
The solution could also be a mobile phone of some sort, that I can lock down.
You could do most of that with any Android handset using prey
http://preyproject.com/blog/2010/01/prey-arrives-on-mobiles-android-version-available
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to write software in visual basic that reads the barcode of various items into my program. Any suggestions for how to do this?
If you have a hardware barcode scanner to hand it will almost certainly imitate a keyboard, and send the barcode as keystrokes (no special code required, just a textbox and it will put it in there once it is focused).
If you go to the manufacturers website, you will find exactly what it does, and even special barcodes for programming your scanner (such as sending newlines at the end of barcodes, etc).
Otherwise, see my comment to your question above.
You don't need code to read the barcode scanner. It usually comes into the system exactly like it came from the keyboard. Make your app work for the keyboard and you are there.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last year.
Improve this question
The .net compact framework on smartphones doesn't know the button component, the reasons are unknown to me. My question is: how do people usually get over this problem? I have know smartphone near me to check out, only a pda phone, which of course has touch screen and supports the button component.
What would you do ?
The lack of buttons is intentional as it violates Microsoft guidelines for smartphone platform. Instead you should use the menu, which for a thumb operated device is faster. It also helps to provide a common interface for all phone's applications.
If you need to have a button, you can easily create one of your own. see also this question.