Turtle: MouseIn() method implemented. (using onmouseover event)

git-svn-id: svn://ultimatepp.org/upp/trunk@15013 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
oblivion 2020-09-10 20:38:54 +00:00
parent dda2fb3af3
commit 00048c19ca
4 changed files with 18 additions and 3 deletions

View file

@ -36,7 +36,7 @@ bool TurtleServer::ProcessEvent(bool *quit)
try
{
if(p.Id("I"))
if(p.Id("i"))
{
ResetImageCache();
}
@ -56,9 +56,15 @@ bool TurtleServer::ProcessEvent(bool *quit)
MouseWheel(p);
}
else
if(p.Id("I"))
{
mousein = true;
}
else
if(p.Id("O"))
{
mousebuttons = 0;
mousein = false;
}
else
if(p.Id("D"))

View file

@ -13,6 +13,7 @@ bool TurtleServer::debugmode;
WebSocket TurtleServer::websocket;
int TurtleServer::mainpid;
bool TurtleServer::quit;
bool TurtleServer::mousein;
dword TurtleServer::mousebuttons = 0;
dword TurtleServer::modifierkeys = 0;
Size TurtleServer::desktopsize = Size(1024, 1024);

View file

@ -27,7 +27,7 @@ private:
virtual Size GetSize() { return desktopsize; }
virtual dword GetMouseButtons() { return mousebuttons; }
virtual dword GetModKeys() { return modifierkeys; }
virtual bool IsMouseIn() { return true; }
virtual bool IsMouseIn() { return mousein; }
virtual bool ProcessEvent(bool *quit);
virtual void WaitEvent(int ms);
virtual bool IsWaitingEvent();
@ -145,6 +145,7 @@ private:
static String ip;
static int connection_limit;
static bool debugmode;
static bool mousein;
public:
// Statistics.

View file

@ -426,7 +426,7 @@ function SRect(p, sx, sy)
window.img_cache = {};
window.event_queue = "I\n";
window.event_queue = "i\n";
window.cursor_cache = {};
window.update_serial_l = 0;
window.update_serial_h = 0;
@ -464,6 +464,13 @@ canvas.onmouseout = function(event)
event.preventDefault();
}
canvas.onmouseover = function(event)
{
event_queue += "I\n";
ScheduleSend();
event.preventDefault();
}
canvas.onmouseup = function(event)
{
event_queue += "U " + event.button + mouse_event(event);