I have an dialog based application running on WinCE. The app is developed using Win32 APIs. I have two yellow buttons on my handheld whose virtual keys are 136 and 137. I need to trap these keys throughout my application. (Irrespective of where the input focus is at that moment)
Note that since I have a dialog based application, a simple trapping of WM_KEYDOWN message won't work as a WM_COMMAND message is generated on a dialog. The situation gets more complex when the input focus is on the edit controls.
I thought of following two approaches.
1) Using Hooks.
2) Using Sub Classing.
Using Hooks:
A low level keyboard hook can be installed. This will allow us to trap the key press of these two btns. Although this approach seems to be feasible, the problem is that MSDN states that low level keyboard hook is not supported on Windows CE. I found out that despite this claim by Microsoft, hook APIs do work on Windows CE. But by using hooks a risk is inculcated. Because officially, Microsoft can stop supporting these functions in further versions of windows CE.
Using Sub Classing:
The edit controls on each dialog can be subclassed and trap the key press of these btns. This will have to be done for each control on each dialog. This will mean touching considerable amount of code. This can impact substantial part of existing working code and will need thorough testing of every screen. The application has 76 screens with controls on most of them.
Is there any other way to achieve my objective?
Thanks for having patience to read my query.
Hoping 4 a soln
Related
Having grown tired of SPHelper and similar apps that don't truly interface PPC programs well on Smartphones, I've conceptualized a new approach that should be very do-able with the right programmer.
SmartCursor a Virtual Mouse for Smartphones
Using the camera as an input to judge the motion of the phone, translate this into an onscreen mouse pointer (ala' SPHelper) to allow smartphones to point and click onscreen controls. This would allow the use of some PocketPC (PPC) software by giving them a viable, intuitive, and speedy system to select any onscreen gadgets.
The 'click' button would be user-configurable so that any button they desire to use on the Smartphone can be used to be the 'down click' of the virtual mouse. In this way you could assign it to any of the extra buttons available on the side of the phone or on keyboards (like on the Dash).
Another button would also turn ON/OFF the virtual mouse as well so the app could be available at any time without affecting apps that don't need it.
Portrait to landscape mode changing (helloooo iPhone and Vox!) could be done by camera motion judging as well. Also flipping display upside down - whatever is supported in the OS of course.
Settings/preferences should include list of applications to suspend SmartCursor operations while these apps are in operation. Camera, VideoRecorder, etc. User can add apps as needed along with notes to suspend while 'in front' or suspend while active.
Alternate operation, if needed to prevent this app from slowing down other apps, hold activation button UNTIL desired click area is under cursor, send click, then suspend until activation button is held again.
With an app like this use of PPC apps, once successfully installed, would be a snap (of the wrist)!
Personally I just like the idea. I'm not as fond of the PPC OS as I am of the Smartphone OS. However a few apps, like Opera Mobile, could really benefit from having a virtual cursor program that is reliable and easy to use.
The key to future development would be the free availability of this application which is why I'm not trying to patent the idea, copyright it, or trademark anything about it. The idea is now public domain and I release the concept for any non-commerical use!
Kermit Woodall
This question is for WiMo Standard developers. I am a Windows .NET developer willing to learn more of this platform if you guys think this is doable and relatively simple.
Do you think it's possible and would you say it's relatively easy to implement a "dormant" application (in the Windows desktop world, this would be a service or any other type of TSR application) that intercepts keystrokes (interrupts?) and sends to the OS another keystroke defined in some sort of mapping configuration?
What I'd like to have (or be able to build) is an application that will intercept a keystroke like Fn+A while typing text and type á (or Á, depending on whether I'm writing in lower or uppercases). If I don't release Fn, but press A again within a second or so, then replace that previous letter by à (or À) and then by â (or Â), etc. Just toggle through all the foreign characters that resemble the letter A (configurable through a GUI or even a configuration file) until the Fn key (or Ctrl, etc., depending on the device) is released. Most QWERTY WiMo phones do this, but not all and the Samsung BlackJack II (i617) is an example. That is really my biggest complain with this phone and I'd love to overcome it.
Keep in mind that, although this may seem like an easy task at first, there are many things to take into consideration. For example:
- The application should only work when the device is accepting text input, not when it's in the home screen, a menu, etc.
- The application should be able to handle more than one mapping per key combination.
- The application should be able to delete the previously written character if Fn was not released and the second key was pressed again and a new mapping was found (á, backspace, à, backspace, â, release Fn, done!).
- The application should be able to determine whether the next letter was supposed to be lower or uppercase and return the correct character.
- The application should become friendly with T9 if enabled (or disable itself if T9 is enabled; I personally wouldn't care, since I always disable T9).
TIA for your feedback!
Is there a way of submitting Alt commands via an Android keyboard to my windows PC?
I presently use Air Mouse on an Ipod Touch to control my HTPC remotely.
This is the only use I have for the thing and I'd like to think that there will be the perfect Android solution for me soon.
The benefit of Air Mouse over RemoteDroid and GMote is the Alt key ability which neither of the Android apps have (or if they have I haven't found it yet), a function I find a lot of use for.
(I should add that the only Android device I have at present is an HTC Desire....so I guess that could be the limitation rather than the apps)
I don't really understand what you mean by alt key ability. Could you please explain, and maybe we can help sugest a solution?
What is it that this alt key ability of air mouse do, or more importantly, what is it that you want to accomplish with such an alt key ability?
Thanks for the reply, I had a feeling I wasn't being very clear.
I'd like to use my Android device as a trackpad and mouse for my HTPC.
My media player of choice (MPC-HC) uses a lot of keyboard shortcuts with the "Alt" signifier. For example Alt+X closes the program. These shortcuts are especially important because the program runs in a fullscreen mode which removes any context menus.
All the various android soft keyboards I have seen have no Alt key so I would lose a lot of functionality controlling the HTPC from an android device.
I have read that pressing the trackball twice on an HTC Desire may be a substitute for pressing the "Alt" key but have never got this to work in practice.
Just found an app that might suit your needs. I suggest you check it out.
GRemote Pro
Edit:
Ok, I just tried this app out, and it does exactly what you need.
It comes packed with an app alt, ctrl, tab and del buttons that let you alt+tab among other things.
I didn't see MPC-HC in the server setup, but that's not a problem as you can configure your own profiles with specific commands.
Fair warning, it's a bit on the slow side (seems to be a port of a winmo app), but I'm sure it'll get better with time and updates. It's a very polished Remote app for android and it even comes with drivers for a G-sensor controller to play games with (use android as wii-mote/controller).
This app defenitly rocks.
You sir (or madam) are a legend.
I was disappointed at first to see that this app doesn't simply add Alt and Ctrl keys to the standard keyboard, but it does allow considerable control of the media player directly.
Need to have a much longer play to see if it's really what I need...but I appreciate your effort already.
Another Suggestion
Have you tried unified remote?
It's got a full windows keyboard, You can create your own custom remotes and if you wanted, you could even have multiple droids connected.
Yes, this reply is s bit late, but better late than never
try Hackers Keyboard
I installed hackers keyboard and tried to activate it. It gives a prompt message that this will collect all information except passwords, including personal data and credit card numbers....!!!
Hi I succeed to finish my code of simple viewer PC screen. Work with WP7
See the video
http://www.youtube.com/watch?v=cCwsuj7Hcno&list=HL1330329890&feature=mh_lolz
Now I will go to try how control the mouse?
About my app I use socket to connect to the server, no RDP protool and its word good. I try it on different machines and networks (@IP) and work perfect.
My app is a last year project so any idea about how to control the cursor.
This probably should have been in the same thread, but anyhow...
It depends on how your protocol is designed. Currently, all the data is pushed from the PC to the phone. To control the cursor, your phone needs to push data to the PC, which means that the PC server app needs to check for data from the phone app.
Sensing a touch on the phone is easy. Sending those coordinates over the network is pretty easy as well; you figured out sending video so I assume you can handle this part. On the PC, you'll want to receive those coordinates and then multiply them back out to their equivalent positions at the PC's resolution. Then you need to move the mouse cursor. There are Windows APIs for doing this, but I've never messed with them. They might be exposed to .NET, but I'm guessing that you'll need to make a call into native code (this is pretty easy, though; look up P/Invoke). Clicking can be implemented by having the phone detect that you tapped the same spot where the cursor already is, and having it send a different message to the server.
The messages will need to be determined by you, as the designer of the protocol. I do recommend using different messages for "move the cursor to here" and "click where the cursor is now." As for when to send the message, that also depends on how you implemented the app. If the entire transmission of the screen frame is one long socket send/receive, you'll have to exchange cursor commands between frames. If you do multiple smaller chunks, you can check for a cursom command and update the position or click as appropriate. Another alternative is to create two socket connections, and have the second one be used for cusor commands. I don't recommend this, though - it's not needed, it takes more code, and although I feel that everybody *should* learn multi-threaded netcode development, I'm not sure it what you want to work on now.
I am really confused
But I will try to get the coordinate of cursor from PC and move it on WP7 screen at first, if I succeed I will develop code tap (click), double tap and drag.
I am really confused
No one can help!!!!!!!!!!!!
Google should be your best helper - try to work with google first.
On WP7 app side you need to grab tap position, translate it to desktop coordinates and send data to the server. On the server side you may use Win32 API function SendInput() http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx
SendInput can emulate mouse and keyboard events.
P.S. As for youtube video: try your project on the real device, using WiFi or 3G, and you will understand what RDP protocol was built for
Yes I use Google for that,its the best search engine
I understand that use the coordinates to locate the position, and send it from WP7 to PC.
But my question is how any sample code can hep?
The BSP monkey feature in Android is a tool that automatically generates random user input events, such as clicks, touches, and text input, to test the functionality of an app. This can help developers ensure that their app works properly and can handle unexpected user interactions. The "BSP" stands for "Back, Home, and Overview," which are buttons found on most Android devices that allow users to navigate between different apps. The monkey feature is used to simulate these and other inputs to test how the app responds.