CheerpJ能否将Java的mouseDragged动作扩展到applet框架外部?

huangapple go评论75阅读模式
英文:

Can CheerpJ extend Java mouseDragged actions outside an applet frame?

问题

这个页面中,CheerpJ对这个页面中的小程序进行的转换(具有相同的字节码),似乎无法识别鼠标拖动穿过小程序框架边界的情况。如果能实现这一点将会很好。

这只是我的客户端设置的问题(Linux Debian 9.2),还是其他人也看到了相同的行为?

非常奇怪的是,原始行为在不受CheerpJ支持的iPhone浏览器上转换正确(我在Safari和Firefox上都检查过)。调查这个事实是否可以帮助CheerpJ的开发人员了解如何使MouseMotionListener接口能够在屏幕的任何位置识别鼠标拖动,而不仅仅是在小程序框架内部?

也许这是不可能的,但我认为这值得一问。

编辑: 更改标题,对CheerpJ的评价更加中性(总体上,我觉得CheerpJ几乎难以置信!),并且更能反映实际问题。

英文:

In this page the CheerpJ conversion of the applet in this page (with identical byte-code) does not seem to recognize mouse dragging past the applet frame boundary. It would be nice if that were possible.

Is this just a problem with my client-side setup (Linux Debian 9.2), or do others see the same behvior?

What is very strange, is that the original behavior is converted correctly on the not-supported-by-CheerpJ iphone browsers (I have checked safari and firefox there). Could investigation of this fact help CheerpJ developers understand how to make the MouseMotionListener interface recognize mouse dragging anywhere on the screen, not just within the applet frame?

Maybe this is impossible, but I thought it was worth asking.

Edit: Changed title to be less negative about CheerpJ (which overall I find almost too cool to be true!) and more reflective of actual the question.

答案1

得分: 1

mouseDragged方法已根据我们的最佳理解正确实现。这个Java事件派生自mousemoveJavaScript事件,当鼠标在小程序表面之外时不会触发该事件。在传统插件小程序中,小程序显示在具有不同行为的本机窗口上。

使用不同的JavaScript事件(例如mousedrag)可能会使CheerpJ的行为更类似于本机行为,但要在不引起退化的情况下重新设计这一点需要进行大量的工作,而且目前并不是我们的首要任务。特别是考虑到我们的客户通常会拥有全屏的Swing小程序,这些小程序不会出现该问题。

在移动设备上,使用的是touchmove事件,这可能是你所看到的差异的原因。

如果您想要报告错误,您可以在这里进行:https://github.com/leaningtech/cheerpj-meta/issues

英文:

The mouseDragged method is correctly implemented to the best of our understanding. The Java event is derived from the mousemove JavaScript event which is not delivered when the mouse is outside of the applet surface. With the legacy plugin applets are displayed on native windows which have different behavior.

It could be possible that using different JavaScript events, like mousedrag would make CheerpJ behavior more similar to native, but reworking this without causing regressions would require significant work and it is not currently a priority for us. Especially considering that our customers normally have full screen Swing applets which cannot exhibit the problem

On mobile devices the touchmove event is used, which is probably what causes the difference you see.

If you want to report a bug you can do it here: https://github.com/leaningtech/cheerpj-meta/issues

huangapple
  • 本文由 发表于 2020年7月25日 09:42:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/63083431.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定