Question: I have some TextFields with Masks (One is > for all uppercase - one is for numbers ####, etc etc)
I can right click and copy and right click and paste, but doing CTRL+C or CTRL+V creates bizarre characters. (CTRL + any key does)
CTRL+C =
CTRL+V =
CTRL+Z =
CTRL + H = Simulates pressing backspace
Control + Other keys do other random characters.
Am I doing something wrong or is this expected behavior for a TextField mask? Why does it do this on only TextFields with masks, and is there a way to restore default TextField functionality to a masked TextField
This is all on Windows; I haven’t tested it on OS X with Command key
[edit] I have confirmed this behavior only exists on Windows; OS X does not encounter such characters with either CMD or CTRL
The first text field is the " > " mask which should make all letters capital. It works, but try to CTRL+C or CTRL+V to copy and paste. See the ASCII characters and/or ASCII boxes?
The second text field’s mask is " >DOG####### " - try to type DOG1234 and then copy it with CTRL+C … does it create “OG” for you then?
These are the issues I am encountering with the mask function.
This only affects Windows, and does not seem to be an issue on Mac OS X
Thanks to anyone who has time to look at this. Sorry for pasting the program code as Xojo XML but I don’t want to go make a Dropbox account for a 25 KB demo program
Did you REMOVE THE DEFAULT menus for the application? From the screen shot, it looks like you did.
Those MUST remain intact for the cut/paste/select all etc keys to work.
You can HIDE them if you wish, but you cannot DELETE them
So I guess I either have to see a menu bar I don’t want, or lose Copy+Paste shortcut capabilities?
[EDIT]
Also, even without the menu bar shortcuts work (Copy, Paste, Select All, etc…) it’s ONLY when there is a MASK applied to a TextField that the problem exists and required the menu bar
Dave - cut copy paste etc work (at least in Windows & OS X) without the menu bar and NO special code to handle them
Reread Zachary’s post where he says [quote=264999:@Zachary Milbourn]
Also, even without the menu bar shortcuts work (Copy, Paste, Select All, etc…) it’s ONLY when there is a MASK applied to a TextField that the problem exists and required the menu bar[/quote]
It’s ONLY when the mask is applied that the issue arises
If you want to hide menuitems, you can also create different versions of the menubar, some with and others without, and switch the active menu bar for the window with self.menuBar.
I am sorry I misunderstood your previous post… I just tried it Michel and that works really well! It hides the menu bar but retains the copy and paste functionality on Windows.
Thank you Dave, Michel, and Norman. The issue is now resolved on my program!
Ok… CTRL A - Z… these are not normally “printable” characters… so exactly what did you expect?
On OSX… check out OPTION A-Z, these too will give “special characters”, but then that is by design
I did fire up a Mac and did Option+letters and it types characters in the manner which you described. It seemingly occurs in any application. I am not a Mac user so this is foreign to me, but apparently this is par for the course.
That is not normal behavior for Windows, however. I can’t go to any other application (Notepad), hold CTRL and get ASCII characters.
Why does it produce these characters when a mask is applied but it does not produce them without a mask?