Virtual keyboard in Symbian S60 5th edition: Which API to use? - keyboard

How (i.e. using which API) is the virtual keyboard opened on Symbian S60 5th edition? The documentation seems to lack information about this.

You are right, this should obviously be a published API and it should be highlighted in the documentation. No such luck.
If you are using one of the platform native controls, the virtual keyboard will automatically popup when the user accesses a text-editing control.
If you are making a custom control, you need to deal with its selection by adding your own version of the virtual keyboard: make a new text-editing, window-owning virtual keyboard look-alike custom control with the right buttons. Reuse it accross all your applications. One day, Nokia will realize they have made an obvious mistake and make the API publicly available.
If you are using direct screen access, well, you wouldn't exactly expect the very s60-looking virtual keyboard to popup out of nowwhere. Again, draw a nice image on the screen to let the user know where the virtual keys are and react to pointer events. This is going to be less reusable unless you build a good amount of customization (background, button edges...) into it.
EDIT: Nokia may be relying on Qt to fix this issue. I would expect the control to be part of the current 4.7 version of Qt.

Tinkering with focus on a QLineEdit inside custom coded kinetic scroll area, I've had a simmilar problem (how to open virtual keyboard manually). Then, I found it, this obviously works in Qt 4.6.3 on a C7 Symbian^3 phone:
// lineEdit is an instance of QLineEdit
QApplication::postEvent(lineEdit, new QEvent(QEvent::RequestSoftwareInputPanel));
Before that, I also had to post a QEvent::FocusIn event to that same lineedit, otherwise the QLineEdit did not update the content from virtual keyboard.
Hope this is helpful. I lost hours.

Thank you tihi, very useful tip! There's also the "close virtual keyboard" event that can be triggered:
QApplication::postEvent(lineEdit, new QEvent(QEvent::CloseSoftwareInputPanel));

Related

Developing a TV application

I have been trying to build a TV application, using an SD.
I have got features like image gallery, video player running,
However, I also wanted to add a virtual on-screen keyboard that works with up-down left-right arrow keys. Can somebody help me with how to get started?
When I wanted to do this with my Vestel (Polaroid Branded) smart TV, which uses "Opera for TV devices" as it's HbbTV browser, I found that I didn't need to.
I simply just used HTML text fields and input types where needed, and as soon as I clicked into them, the browser/OS kernel popped up an onscreen keyboard that was built in for me.
However, I did do some research to see if I needed it, and on some devices you do, whilst I never actually implemented it (My app was just for my own use) the "BBC Television Application Layer" (TAL for short) : https://github.com/bbc/tal had pretty good keyboard support.
Another one that might be worth looking at is "Mautilus SDK" : https://github.com/mautilus/sdk
Be aware though, both are horribly convoluted and use quite complex code where it's really not needed.

Modifying the screen of existing Direct2D application

This question is related to: Which API Microsoft Word (Office 2013) is using the paint the screen, which was left unanswered.
I have an Office plug-in (native C++) which is fairly involving with Office. Using hooks I'm modifying the client area of Office application.
Things were working great for me up to Office 2010, hooking WM_NCPAINT, and using GDI method on the Office Window.
But Office 2013 uses Direct2D, DXGI, and DirectWrite. On Windows 7, if I draw something on the screen - it gets erased the next time the cursor blink. On Windows 8 - I don't even have access to the screen.
Currently, my thinking is to hook ID2D1DeviceContext::BeginDraw, ID2D1DeviceContext::EndDraw - and on last function, just before delegating to the real function, I will add my stuff. Another idea is the hook IDXGISwapChain1::Present1. Problem with both these methods that I've hard time identifying what is going on above.
I'm even thinking even a different process (or GDI based window - if possible) on top of the client area I want to decorate, with the majority of the real eastate being 100% transparent. Problem with this solution are issues like keyboard focus and mouse click.
Any tip or suggestion will be appreciated. Any tool (the Spy++ for DirectX) will be appreciated. Does DirectX (specifically Direct2D) has documented extensible or plug-able story, I'm not aware of and could use? Is there anything in Kernel Mode I'm missing?
Hm dont know exactly how that works on Direct Draw, but i hooked once the EndScene function for Direct3D and added some stuff to the scene before the real EndScene could be executed.
I made a little video that shows that:
http://www.youtube.com/watch?v=ZFshqIEaLBc
Here's my advice: don't do that. Any of it. If you find yourself having to hook and hack into the host that deeply, it's a clear sign that you just shouldn't be doing that. Find another way to draw what you need, or change your UI design so that it fits in with what Office already accomodates. Even if you assume it's possible to get this working, every time Office is updated (patch, service pack, new version) you will be at high risk of all your stuff breaking, with no guarantee that you'll be able to get it working again.

Entering text in Windows 8 in C#/MonoGame app

I'm writing a WinRT game for Windows 8, in C#, using the excellent MonoGame. I've reached the part where the user has achieved a high score and needs to enter their name. This is causing me more pain than I'd anticipated so I thought I'd ask for help.
First of all, is there a simple "enter some text" function that I can call, similar to Guide.BeginShowKeyboardInput in Windows Phone 7, or the ancient InputBox command in VB? I'm using Windows.UI.Popups.MessageDialog for displaying simple dialog messages, but can't find any similar thing for requesting text from the user.
Failing that, is there a way I can easily use a little piece of XAML to present a textbox for the user to use?
If neither of these are possible, I guess I'll have to wire this all up myself... I then would plan to intercept keystrokes and display the required text on screen myself. As I don't have a physical tablet (just the simulator) I'm struggling to start with this. How can I:
Detect whether the device has a physical keyboard, so I know whether or not to display the on screen keyboard?
If there is no physical keyboard, how can I show and hide the on screen keyboard?
Some of these sound like they should be easy to answer, but I've yet to track down answers to any of them.
Many thanks!
Adam.
Hey there is such a way to do this in monogame. There is a new template that allows you to create a XAML + Game game which allows you to use the game class you a used to with the xaml bits as well. These links should get you started. The monogame team rocks.
There are the three game types listed there. You want XAML + Game there is a template for it now if you get the proper version of monogame.
https://github.com/mono/MonoGame/wiki/Windows-8-Project-Types
let me know if you need more help
This is not a cross platform solution but you could use a FlyOut and place the controls for data entry on the window. FlyOut guidelines are here and UI Controls for text input guidelines are here. I have also used MessageDialog in a MonoGame for asking the user simple questions (up to 3 options) or to get a Yes|No response. You can get details of that class here.

Does anyone know how to map Microsoft's Instant Viewer mouse function to a keyboard?

After reading Jeff's review of Microsoft's Natural Ergonomic Keyboard 4000. I decided to get one. It comes with this really nice Instant Viewer feature that it assigns to the middle button of your mouse. Not wanting to lose my middle button "open in new tab" function. I wanted to assign it to the keyboard. I'v looked at task manager when using it and it seems to be part of the ipoint.exe.
Does anyone know if its possible to assign it to the keyboard and how?
Did you try to do it using Microsoft's keyboard software (IntelliType Pro) and mouse software (IntelliPoint)?
I just installed Intellitype Pro 7.1 on XP (I didn't install Intellipoint) and it does let you assign Instant Viewer to a key. You might need a Microsoft keyboard to use it though (you need an M$ mouse for Intellipoint).

Customizing/Replacing the Windows CE 5.0 Taskbar?

I'm currently getting my feet wet with Win CE 5.0 to update some code on an existing platform. We're interested in deploying a custom shell/home screen/application launcher as well and I had a couple questions:
1) We're running the standard CE shell and I'm assuming it can be customized because the source code is made available with Platform Builder. I was wondering how "painful" it would be to completely replace it with something like a status bar at the top of the screen (think iPhone). I was thinking task switching could then be handled by shortcut keys exclusively. I have my doubts about this.
2) If it can't be removed, can the taskbar be resized and moved to the top of the screen? We're basically trying to find a way to reserve the first 20 or so pixel rows at the top of the screen for our own status bar and prevent maximized application windows from drawing over top of it.
Thanks very much for the help.
-ksudeadeye
I was happy and angry when I found the solution because it's more easy than I expect.
For 2) reserve space you need to do this:
RECT rc;
SetRect(&rc, 0, 25, GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN));
SystemParametersInfoW(SPI_SETWORKAREA, 0, (void*) &rc, SPIF_SENDCHANGE);
With this code you reserve 25 pixels in the top of the screen.
:D
If you have doubts maybe this can help you or this.
Good luck.
To hide the task bar is a simple registry change:
; Hide the windows tasbar by default.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\AutoHide]
""=dword:1
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\OnTop]
""=dword:0
As far as customizing, your own, that is a little more work, and not something I've attempted.
I have some experience with modifying the taskbar in CE 5.0. It is not an easy task, but the results can really add that personal touch to the device. I was tasked with adding a user mode second taskbar with a password dialog and a second type of shell notification to add icons to the user bar.
In the end, it is just standard Windows CE programming - the taskbar, notification tray, start button, etc. are just like any other windows in the CE environment.
You should start exploring here:
C:\WINCE500\PUBLIC\SHELL\OAK\HPC\EXPLORER\TASKBAR\taskbar.cpp
Be careful, clone your code, and be prepared for lots of debug cycles. This is more than 5000 lines of serious spaghetti code.

Resources