[quote=402133:@Greg O’Lone]if keyboard.commandkey and key = V then
Return True
End If[/quote]
didn’t stop it for me… those key strokes never even get to keydown
Deleting the “Paste” menu item from the “Edit” menu does it but all controls are affected, any better solution?
But text can still be dragged into the textField successfully.
[quote=402200:@Alberto De Poo]And for the dragging issue:
TextField1 - Open event - me.AcceptTextDrop
TextField1 - DropObject event - Return
at least it works on macOS[/quote]
Funny, was going to post the same, but it also raises a question:
If you DO NOT have me.AcceptTextDrop in the open event, the TextField and TextArea will still accept a Text drop. Maybe THAT should be considered a bug?
I did just a test and it does not work. It seems so that the Edit menu items are handled from the TextField class already. So my idea does not work (or t least not in a simple way).
[quote=402201:@Markus Winter]Funny, was going to post the same, but it also raises a question:
If you DO NOT have me.AcceptTextDrop in the open event, the TextField and TextArea will still accept a Text drop. Maybe THAT should be considered a bug?[/quote]
Exactly, I was trying different things to make it work. Because I don’t know Xojo enough I tried me.AcceptTextDrop = False and of course it doesn’t work that way.
So I guessed, well maybe the drag is a system event that Xojo can’t catch (like the firing of command V), then me.AcceptTextDrop maybe will make Xojo ‘aware’ that a drag is happening and I put MsgBox obj.text in DropObject. I saw that I get the MsgBox and no text on the TextField1, then changed MsgBox to Return.
I just set a TextField to ReadOnly, and drop a text file is rejected, Paste text data too, and of course typing text too, but you do not wanted that (you specifically say you want to be able to type text from the Keyboard.
Tested on Windows, dragging is not possible by default, you need to add the me.AcceptTextDrop and then you need to handle the drop (add some code to DropObject)