-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy-Paste Shortcuts Not Working #1199
Comments
Unfortunately, the problem seems be unreliable itself. I couldn't able to reproduce the problem in my recent tests so far, on macOS. Copy/paste works as usual, although I myself seen the copy/paste problem in past. |
I'm reproducing that problem quite often. It's been with us for a while and I cannot find consistent scenario when it is happen, but I will try from now on at least gather some scenarios to report here. |
@joshtynjala do you think it's something at haxe-editor-API side, and you wants to look into (?) |
The problem with this issue is that it has been difficult to reproduce consistently. I was able to reproduce this with Domino Visual Editor (with development 3.3.4 build 3045), but I'm not sure this covers the issues that @rat-moonshine and @piotrzarzycki21 are seeing:
Note that we have a pending update for copy-paste logic. However, this did not fix the above test case. |
I wonder if there's a conflict with focus between Flex and Feathers UI. Or maybe some other code in Moonshine is sometimes calling event.preventDefault() elsewhere, which may prevent the text editor from performing the copy/paste task. I'll investigate. |
I was able to reproduce by creating a Domino Visual Editor project and opening the .form file. While the .form file remains open, even if it is not the active editor, AIR is not dispatching |
With a little time following all In UndoManagerVisualEditor, Presumably, this listener should look more like this, so that other keys are allowed. private function handleKeyDown(event:KeyboardEvent):void
{
if ((event.keyCode == 22 || event.ctrlKey) && !event.altKey)
{
switch (event.keyCode)
{
case Keyboard.Y: // Y
event.stopImmediatePropagation();
event.preventDefault();
markEventAsPending('redo');
break;
case Keyboard.Z: // Z
event.stopImmediatePropagation();
event.preventDefault();
markEventAsPending('undo');
break;
}
}
} |
@piotrzarzycki21 can you think anything on the above line (?) since you knows better this part of the system. |
I updated the class-file that matches the suggestion from @joshtynjala . However, for some reason I can't able to build Moonshine using Moonshine-IDE on macOS recently. There was no error but some warnings only. I still need to figure why this breaks. Meantime, I commit the |
@rat-moonshine Now copy/paste by shortcuts doesn't work at all. Try to fix your local build and test with these changes. |
However CMD+X does work. |
Now it's started to work, so I'm not sure what has happened initially. I will observe behaviour on my Mac. |
@rat-moonshine unfortunately that changes still didn't help. I do have this issue again - it's intermittent. How is going on your sight ? |
So far I haven't noticed this during my tests. |
@piotrzarzycki21 has still been seeing rare issues with the shortcuts for Royale and Haxe projects. I haven't noticed any problems with this in my recent work in Java projects. |
The only scenario the copy/paste-shortcut still failing I see on macOS, is as follows:
From above behaviour, my assumption that until the system clipboard populated by some other application for first time, Moonshine not able to populate the clipboard by itself. For some reason the To understand whether this problem is limited to Test 1
Test 2
Test 3
Recently, @joshtynjala has enabled copy/paste shortcuts in |
@joshtynjala please, check this, if you can provide your thought on Test.3, at some time. I was wondering if Test.3 could give us some hint on continued problem with copy/paste, in Moonshine-IDE. |
I can reproduce Test 3 on Adobe AIR. It appears to be an AIR bug. I confirmed that Event.COPY is correctly dispatched by AIR. My call to Clipboard.generalClipboard.setData() returns true, indicating that it should have worked correctly. However, a call to Clipboard.generalClipboard.getData() returns null instead of the text that I set. If I switch to another app, copy some text, and then switch back to the AIR app and try to copy again, everything works correctly. Instead of null from Clipboard.generalClipboard.getData(), I get the string that I passed to Clipboard.generalClipboard.setData(), which is what should have happened the first time. |
Do you think this clipboard bug could reason to the original issue here, @joshtynjala (?) |
Yes, that could certainly be the reason. If it happens again, one way to test if this is the cause would be to switch to another app and copy some text. Then, switch back to Moonshine and try to copy/paste again. |
Yes, I think I mentioned this at sometime to @JoelProminic , that if we copied some texts from another app, and paste into Moonshine-IDE editor, from then copy/paste works accordingly. So that behaviour match with yours. |
Last day @piotrzarzycki21 suggested to log an issue at Harman on Clipboard bug, but I just realised that we did tests already and it didn't shown as AIR specific bug, here in Test 1. The bug seems to trigger when bridge between Haxe and AIR, so I don't think we have a strong reasoning to log this as an issue in AIR, to Harman. |
var sprite:Sprite = new Sprite();
sprite.x = 20;
sprite.y = 20;
sprite.graphics.beginFill(0xff0000);
sprite.graphics.drawRect(0, 0, 200, 100);
sprite.graphics.endFill();
sprite.tabEnabled = true;
addChild(sprite);
// click the sprite and then press Ctrl/Cmd+C
stage.addEventListener(Event.COPY, function(event:Event):Void {
trace(event);
Clipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, "hello");
trace(Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT));
}); |
Sorry, I was mistaken. I had forgotten the important step of restarting my system before launching the .app file. I can reproduce the issue in a plain Haxe/OpenFL project targeting AIR without Feathers UI or the TextEditor component. In fact, I can also reproduce in a pure ActionScript 3.0 AIR project, using the following code (macOS 14.2.1, Apple Silicon M3): package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.desktop.Clipboard;
import flash.desktop.ClipboardFormats;
import flash.text.TextField;
public class ClipboardSetDataAfterRestartBug extends Sprite
{
public function ClipboardSetDataAfterRestartBug()
{
stage.nativeWindow.visible = true;
var tf:TextField = new TextField();
tf.width = stage.stageWidth;
tf.height = stage.stageHeight;
tf.tabEnabled = false;
tf.mouseEnabled = false;
tf.mouseWheelEnabled = false;
addChild(tf);
var sprite:Sprite = new Sprite();
sprite.x = 20;
sprite.y = 20;
sprite.graphics.beginFill(0xff0000);
sprite.graphics.drawRect(0, 0, 200, 100);
sprite.graphics.endFill();
sprite.tabEnabled = true;
addChild(sprite);
stage.addEventListener(Event.COPY, function(event:Event):void {
tf.appendText(event + "\n");
Clipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, "hello");
tf.appendText(Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT) + "\n");
});
}
}
} Steps:
The TextField will display something like this:
It should display this instead:
So it is definitely an AIR bug. |
@joshtynjala I build your example to Captive runtime using Air 50.2.2.6 -> I wasn't able to reproduce this issue on my macOS Sonoma 14.3. Can you try @rat-moonshine as well with my app ? |
I confirm that I able to reproduce it while using AIR SDK v50.2 on macOS Ventura. I surprise that somehow my similar AIR tests was passed earlier, that I described as Test 1 at here. Anyway, I reported an issue to Harman AIR SDK repository with requisite example files, here - airsdk/Adobe-Runtime-Support#3039 . |
@rat-moonshine have you tried my build application ? |
@rat-moonshine can you please specify exact version of Air in issue for Air support ? I will send them email directly cause we have payed support so they could look into it. |
Ah! I was thinking about this earlier - if we has a paid-support since the license purchase of Harman AIR. That would be good if we can pass the issue with number, for a support. I have updated AIR version in the issue. |
I just passed it. Thanks for the update. |
Sounds like we will have in upcoming Air release fix for this :) - airsdk/Adobe-Runtime-Support#3039 (comment) |
Since this is making progress, I added it to the current milestone. If it isn't ready by the time we want to do a release, we can bump it to a later release. |
I have been noticing for a while that the copy and paste shortcuts (CMD-C and CMD-V on macOS) do not work in the text editors. I thought that this was only failing for certain file extensions or special cases, but when I did some tests today I found it was failing for everything. I tested these files:
Flex Desktop Project
Java Gradle Project
@rat-moonshine or @piotrzarzycki21, please take a look to see if this can be resolved easily on the Moonshine side. If this is an issue with the editor code, I would like to report this to Josh before he moves on to other big tasks.
The text was updated successfully, but these errors were encountered: