Remove decimal point from on-screen keyboard - windows-phone-7

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.

Related

What software program can I use to build a custom desktop keyboard IME for MacOS?

I would like to make my own version of Mac's ABC-Extended keyboard for typing Pinyin (a way to write Mandarin that indicates tones). But when I use Xcode, I just see a target custom keyboard extension for iOS and nothing for macOS. I've looked into the program Ukulele but it doesn't seem like it will do everything I need. Theoretically I could also put my rules into files like how this article indicates but that also seems cumbersome based on what I want my keyboard to do.
Here's what I want it to do:
First option: user literally types "ni3 hao3" and my logic in real time changes their output to "nǐ hǎo" (there are pinyin/grammar rules for where the tone mark goes)
Secondly (phase 2 in my project), in their user settings for the keyboard, they could indicate they want to convert their text to Hanzi (the characters). So when they type their Pinyin, my algorithm guesses a best guess list of Hanzi characters that matches their Pinyin entry. This would require that I have a downloaded dictionary file for my keyboard.
Thanks for any help! I know how to program it I just need the right software to use :(

Standard (no third-party) way to get numeric keypad working as arrow keys on macOS (Xcode? hidutil?)

I always use numeric keypad as arrows, as I find it more convenient than using an separate arrow pad. Until recently I used a tool Karabiner Elements, but it stopped functionning at Big Sur.
Yes, The Karabiner developer is working on that issue, but it will be better to solve it without relying on a third-party tool.
It will be enough for me to either remap Xcode, or (which is preferred) to change key bindings in the system, using a tool like hidutil.
Xcode's Preferences - Key Binding has a section Text - Section. When I try to modify the binding for say Move Down by pressing Down arrow on numeric keypad it comes up as '2'. Now whereever I press '2', on keyboard or numeric keypad, it always works as Move Down which is certainly not what I am after.
About hidutil. I couldn't find a good manual or any example of keyboard mapping.
Any help?
Had another look at this article. Here is the answer:
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x70000005A,"HIDKeyboardModifierMappingDst":0x700000051},
{"HIDKeyboardModifierMappingSrc":0x700000060,"HIDKeyboardModifierMappingDst":0x700000052},
{"HIDKeyboardModifierMappingSrc":0x70000005C,"HIDKeyboardModifierMappingDst":0x700000050},
{"HIDKeyboardModifierMappingSrc":0x70000005E,"HIDKeyboardModifierMappingDst":0x70000004F},
{"HIDKeyboardModifierMappingSrc":0x70000005F,"HIDKeyboardModifierMappingDst":0x70000004A},
{"HIDKeyboardModifierMappingSrc":0x700000061,"HIDKeyboardModifierMappingDst":0x70000004B},
{"HIDKeyboardModifierMappingSrc":0x700000059,"HIDKeyboardModifierMappingDst":0x70000004D},
{"HIDKeyboardModifierMappingSrc":0x70000005B,"HIDKeyboardModifierMappingDst":0x70000004E},
{"HIDKeyboardModifierMappingSrc":0x700000062,"HIDKeyboardModifierMappingDst":0x700000049},
{"HIDKeyboardModifierMappingSrc":0x700000063,"HIDKeyboardModifierMappingDst":0x70000004C}]}'
Still can't fugure out, how to do (if possible) complex mapping with modifier keys (eg Ctrl+PgUp to Home), but that's another topic.

How to localize keyboard when InputScope is set to Number?

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

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