How to localize keyboard when InputScope is set to Number? - windows-phone-7

I have an app written for Windows Phone 8 that I ported down-level to Windows Phone 7. The app deals with entering currency values so my TextBox has an InputScope of Number to make things easier to enter. I try to respect the locale setting so that in some countries the decimal in the currency value is represented by "." and in others it is represented by ",".
My issue is that it seems that the keyboard is not localized, so the user has to press and hold on the "." button to select the ",". I believe this may only be a WP7 issue. Unfortunately, some users don't know they can do this trick and thus think they are unable to enter currency values that have decimals in them. It also makes the app tedious to use for anyone that represents numbers this way.
Is there anything I am not setting properly or a workaround for this?
Thanks,
Miron

Unfortunately, it doesn't depend on culture, but you can set another InputScope, i.e. CurrencyAmountAndSymbol which contains both '.' and ','

You may use PostalCode Input scope for your thing

Related

Numeric keyboard as default on Xamarin.Forms, but allow text (cross platform)

Keyboard="Numeric" changes the default input keyboard to a numeric one, but it also makes it so that only numbers and decimal points are accepted -- and there is no way to switch back to an alphanumerical keyboard.
Does anybody know of a way to have the numeric keyboard appear at first, but allow the user to also input text if needed?
Edit: I need this to work for both Android and iOS
You could create your own kayboard with mumber and text like A, B, C, D.....
The link below include how to do this in custom renderer.
https://stackoverflow.com/a/60034046/11850033

Remove decimal point from on-screen keyboard

According to this document, numeric keypad on Windows Phone OS 7.1 is ought to have "." - decimal point.
Is there a way to remove the decimal point from keyboard, leaving only numbers and Backspace sign?
There isn't a way to customize the soft input panel further than the various InputScopes. You could, however attempt to simulate the SIP, but that seems like a lot of extra work just to avoid the ".".
Here is one example that might be of help if you choose to go this route: http://www.silverlightshow.net/items/Windows-Phone-7-Creating-Custom-Keyboard.aspx
Rather than attempt to modify the built in keyboards (which you can't do) or attempt to create a custom keyboard (which is a lot of work to accurately recreate the native experience) you'll probably find it much simpler to just ignore the characters you don't want displayed.
Use the TextChanged event to check for the period and ignore it.

Is ctrl-s save universal for save or are there different combinations for different languages

I imagine that there are different combination, just looking for an affirmation. Or, are we developers really that english-centric?
If I were in Japan, using a word processor on some computer, would Ctrl + S save?
Are there keyboards where Ctrl + S doesn't even exist (non-english keyboards)? Most of what I've seen usually has latin + [insert language here] characters, usually overridden on the normal qwerty keyboard.
It depends.
If the application's UI is in English, most people will expect CTRL + S to save.
If you're writing an application that is going to be translatable, you probably want also the shortcuts to be translatable. Shortcut standard varies between languages and countries. Leave this to the translator.
Yes, Ctrl- and Alt- are usually passed on verbatim and not subject to IME processing—assuming one is using an IME; I don't know about IME-less JP input methods. But in the basic case where an IME is used, Ctrl-S remains Ctrl-S, it does not become Ctrl-す or something.
Furthermore, menu entries often have a Latin accelerator defined - cf. http://www.marsei.net/tec/tecladoEspWindows.jpeg :
addmenuentry(m, "ファイル(&F)");
Just tried on my Mac by setting Spanish as my default language. None of the programs I opened used different shortcuts in Spanish than English, although the menu text was all translated. TextEdit was the main program I used to test.
I also tried setting my keyboard to the Dvorak layout (very different layout, still meant for English), Spanish layout (still QWERTY), and French (a & q, z & w, m & , & ; swapped). Even though the French keyboard had the q in a different place, the shortcut was still CMD-Q.
So, it seems the convention on Mac OS X is to have the shortcuts always use the same letters.
However, according to this link, in Spain CTRL-G(uardar) is normally the shortcut for saving: http://www.ixda.org/node/18527.
Here's an argument for basing the shortcuts on the position of the key on the keyboard, but I'd be surprised if anyone actually does that. http://blog.i18n.ro/are-we-supposed-to-localize-keyboard-shortcuts/
In Visual Studio, CTRL + S saves the document. In MS Office it's the same if it's in English, otherwise if it's in Italian, CTRL + S underlines the text, while SHIFT + something saves the document. I have no idea why they did this, but it might also apply to other applications and languages.
It depends on what you want to write. if you want to write a program and want to publish it everywhere, you should decide if you want it to write in only one language or in lots of languages. If you only want to write it in English, every one that wants to use it should change his/her system language to English or at least should support English. In that way Ctrl + S will do what you want.

Remap keyboard combinations, not just single registry values

I'm getting real tired of pressing shift every time I want to type $ or #. I've checked out key remapping programs like SharpKeys and a few others, but they don't support the SHIFT+[key] actions. The problem is they modify the registry value for a single key only (I think).
I want to flip over my number keys so when I type 4, it outputs $, similar to a French keyboard. (I tried physically rotating the key so it's upside down, but that's not working).
There must be a solution for this - can you help?
The registry hackers move virtual keys around. What you need is a custom keyboard layout. You can easily create your own with the Microsoft KeyBoard Layout Creator utility.
In addition to the answer from #HansPassant, if you find trouble with the ctrl+KEY functions etc you might need to edit the .klc file manually.
See https://superuser.com/questions/171307/how-can-i-restore-ctrlkey-functionality-in-microsoft-keyboard-layout-creator :
You need to modify the .klc file manually.
Basically you just modify the VK_ column to match the value in
column 1.
So for example if you want to bind L to N, you
would create the keyboard as you normally would in KLC. Then you would
open the KLC file in a text editor. Find the value L in the VK_
column, and switch it to an N.
For more information, I wrote the complete steps on my blog.

How to determine if a certain key is pressed, knowing only its position on U.S. keyboards?

Consider that, for a Windows video game, I need to determine if the key which generates the ` and ~ characters on the U.S. English keyboard layout (which is usually below the Escape key and left to 1) has been pressed. This may sound like a trivial question, but it doesn't seem like one to me.
When Windows sends keyboard messages, it specifies the virtual key code and the OEM scan code. We can't rely on the OEM scan code, because "the value depends on the OEM" - and nor can we depend on the virtual key code, because it depends on the currently active keyboard layout.
Our current "solution" is to use LoadKeyboardLayout and MapVirtualKeyEx to find the OEM scan code of the key that generates the ` character on the U.S. English keyboard layout, then just listen for that OEM scan code. The problem is that this doesn't work if the user doesn't have the U.S. English layout installed.
Is there a real way to do this on Windows?
The OEM scancode does not change from keyboard to keyboard. No reason not to use it.
Back in the DOS-days the same scancodes have been used for games because it has been the only way to detect key-up and key-down events. Noone had problems with it and I doubt it will change in the future.
If you want another option you may want to give DirectInput-API a try. It gives you the raw scancodes as well and if I'm not mistaken you can also query the physical position, dimension and whatnot of each key.
Tie the game action to the character, not the position of the key. Otherwise, how do you tell the user which key to press? "under the escape key"? They may not have anything there, but if you tell them "the ^ key", they can look for it.
You'll probably also want to make it configurable to accomodate exotic keyboard layouts and user preferences.

Resources