I have a very simple Windows Phone app with one TextBox. When I type some text, then press Space 2 times, WP7 automatically add a dot.
I dont want the dot. How to handle this ?
Adding a dot when pressing "space" two times is a feature from the WP7 keyboard. The user can disable it from the phone settings.
Since it's a global setting, you can't change it. The best you can do it to forbid the user to type dots altogether (when pressing space two times AND when pressing the dot key). If you want to do that, just subscribe to the TextChanged event of your TextBox, and remove the dots.
Related
On what action do the NSTextEndEditing notifications contain NSLeftTextMovement & NSRightTextMovement? I was trying to catch left/right/up/down key press inside a text field, but the NSTextMovement key value is always either Tab/BackTab or Return.
This will not work to catch arrow key presses in a text field.
The NSTextDidEndEditingNotification is only sent when focus leaves the field editor. So, NSLeftTextMovement would only be used if/when a press of the left arrow press actually caused focus to leave the field. That's not something that normally happens. I don't know if it might happen when using a matrix of text fields or an NSForm. One could arrange to use a custom field editor and have that end editing on an arrow key press, too, I suppose.
This is more a best practices/usability question around the behavior of MacOS apps.
I have an app where a user is constantly typing into a NSTextView (think text editor).
I want to support a few keyboard shortcuts for common tasks within the app so that the user does not need to reach for the mouse to click a button.
But because the user is also typing into a text view, this is a bit tricky figuring out what combinations are available.
All single character keys are off limits (since the user will actually want to type that character).
Most cmd+key combinations are also taken (cmd+c, cmd+left, cmd+right, etc).
What's the expected behavior/best practice here?
when selecting large swaths of text from webpage I have to keep left mouse button pressed while searching for the selection's end. It would be nice if the browser would "remember" selection's start point and let me search for the ending point, e.g. by dragging the scrollbar downwards, without pressing the mouse button.
Does a plugin or other implementation of this sort already exist?
The answer to this is OS/Windowing system specific. In most/all systems there is a normal way to have the system perform what you are desiring. An add-on for Firefox is not required.
Windows:
If you click (button down and up, not button down and hold) at the start, or the end of the selection you desire then move the mouse to the other end of the desired selection (scrolling the page as needed to get the the other end) you can then hold the shift key down and click again. This will select the entire region from the first point you clicked to the second point you clicked while holding the shift key. You can adjust the selection by continuing to hold the shift key while doing any of: clicking on a different location, performing a click-drag movement, or using the keyboard cursor keys. This adjustment does not change the point at which you first clicked, just the second, end point.
It is also possible to use the control key to select individual items. This is possible in combination with clicks, double-clicks, and triple-clicks. An example would be to move your mouse around in this paragraph holding the ctrl key down while double-clicking on various words. Your selection will include just the words on which you double-clicked. In some instances, when using only a single ctrl-click to select from a discrete list (e.g. a Windows Explorer folder display), a second ctrl-click on the same item will de-select it. You can also combine the use of ctrl-click and shift-click to create more complex selections with the beginning of the shift-click selection starting at the most recent ctrl-click location.
The Mouse and Pointers page in the Windows Dev Center provides some fairly technical descriptions as guidelines for Windows developers.
Linux (using GNOME):
The interactions are similar to What was described for Windows, but a bit different. Section 10.1.2. Selecting Objects of the GNOME Human Interface Guidelines 2.2.3 provides a good description.
Apple/OSX:
The Macintosh Human Interface Guidelines describes how selections can be made on Apple machines.
Its a very unusual question, but I'm in need of this feature. In Windows Phone, how can I maintain visible the caret position cursor of a given TextBox, without showing the softkeyboard (virtual keyboard)? In Android this is very possible, but I haven't found anything in WP. Thanks in advance.
This is not possible. Caret is only visible and associated with focus being on that control. The same applies to Soft keyboard.
In VB6, if a listbox containing alphanumeric data has focus and a character key is pressed, the first element in the listbox starting with that character is highlighted. If multiple characters are pressed, the first element starting with each character is selected after each character press. Typing M-A-R-T will select the first M-word, then the first A-word, etc.
What I want to do is write an algorithm that dynamically searches the listbox using a multiple character string. So typing M-A-R-T will highlight the first element beginning with M-A-R-T. The "Sorted" property already does this, but my listboxes are in a wrapper that uses a custom sorting method that gets broken if Sorted is turned on.
I've written all the code to search the listbox and it works correctly, except that the default search behavior is still happening. When I press M, the first M word is highlighted. Then I press A, and the first A word is highlighted. When I release A, the first M-A word is highlighted. Then I press R, and the first R word is highlighted. Then I release R and the first M-A-R word is highlighted. So the behavior is what I want, except there is an extra search being done somewhere between the Keydown and Keyup events.
Is there a way to disable or mask the default listbox searching behavior? Or a way to lock the scrollbar so the system can't scroll it?
Try adding this:
Private Sub List1_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
The automatic scrolling was happening sometime after the KeyDown event. If a form element is disabled, it won't register any key events. So I added these 3 lines after my own filter:
mobjListBox.Enabled = False
mobjListBox.Enabled = True
mobjListBox.SetFocus
I guess when a key is first pressed, VB6 figures out all of the key events it is going to call ahead of time. If the control is disabled, VB refactors the list of key events to call. So by disabling the control I force VB to remove the other Key events (like Scroll) from the workflow. Then I enable the control again and give it back the focus.
Tadaa!