|
From: <dos...@us...> - 2012-03-29 20:37:54
|
Revision: 4468
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4468&view=rev
Author: doskabouter
Date: 2012-03-29 20:37:48 +0000 (Thu, 29 Mar 2012)
Log Message:
-----------
minor cleanup
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2012-03-16 12:28:28 UTC (rev 4467)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2012-03-29 20:37:48 UTC (rev 4468)
@@ -594,43 +594,8 @@
{
linkTime = 0;
MyLog.debug("action key press=" + action.m_key.KeyChar);
- switch (action.m_key.KeyChar)
+ if (action.m_key.KeyChar == 27)
{
- #region 0..9
- case '1':
- linkId += "1";
- break;
- case '2':
- linkId += "2";
- break;
- case '3':
- linkId += "3";
- break;
- case '4':
- linkId += "4";
- break;
- case '5':
- linkId += "5";
- break;
- case '6':
- linkId += "6";
- break;
- case '7':
- linkId += "7";
- break;
- case '8':
- linkId += "8";
- break;
- case '9':
- linkId += "9";
- break;
- case '0':
- linkId += "0";
- break;
- #endregion
- }
- if ((int)action.m_key.KeyChar == 27)
- {
// escape
if (!osd_linkID.Visible)
{
@@ -643,6 +608,9 @@
Application.DoEvents();
}
}
+ else
+ if (action.m_key.KeyChar >= '0' && action.m_key.KeyChar <= '9')
+ linkId += (char)action.m_key.KeyChar;
if (linkId.Length > 4) linkId = linkId.Substring(0, 1);
}
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2012-04-17 21:09:34
|
Revision: 4482
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4482&view=rev
Author: doskabouter
Date: 2012-04-17 21:09:28 +0000 (Tue, 17 Apr 2012)
Log Message:
-----------
placed link-ids on the left of the url, to improve readability
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2012-04-15 14:13:24 UTC (rev 4481)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2012-04-17 21:09:28 UTC (rev 4482)
@@ -55,7 +55,7 @@
#endregion
#region Constants
- private const string _spanstyle = "font-family: arial,sans-serif; font-size: 12px ! important; line-height: 130% ! important; border-width: 1px ! important; border-style: solid ! important; -moz-border-radius: 2px 2px 2px 2px ! important; padding: 0px 2px ! important; margin-left: 2px; max-width: 20px; max-height: 10px ! important; overflow: visible ! important; float: none ! important; display: inline;";
+ private const string _spanstyle = "font-family: arial,sans-serif; font-size: 12px ! important; line-height: 130% ! important; border-width: 1px ! important; border-style: solid ! important; -moz-border-radius: 2px 2px 2px 2px ! important; padding: 0px 2px ! important; margin-right: 2px; max-width: 20px; max-height: 10px ! important; overflow: visible ! important; float: none ! important; display: inline;";
#endregion
#region declare vars
@@ -417,7 +417,7 @@
else
GUIPropertyManager.SetProperty("#btWeb.status", DateTime.Now.ToLongTimeString() + " : " +
action.wID.ToString() + " / " + action.m_key.KeyChar.ToString());
- }
+ }
#endregion
#region selectable buttons
@@ -508,7 +508,6 @@
if (mouse.Visible)
{
mouse.Visible = false;
-
}
else
{
@@ -888,13 +887,29 @@
newChild.InnerHtml = geckoId.ToString();
if (!String.IsNullOrEmpty(className))
newChild.SetAttribute("class", className);
- if (after.NextSibling != null)
- after.ParentNode.InsertBefore(newChild, after.NextSibling);
+ if (after.FirstChild == null)
+ after.AppendChild(newChild);
else
- after.ParentNode.AppendChild(newChild);
+ after.InsertBefore(newChild, after.FirstChild);
return newChild;
}
+ private void SetLinkAttributes(GeckoElement link, int linkNumber, out string id, out string name)
+ {
+ string gb = link.GetAttribute("gb");
+ id = link.GetAttribute("id");
+ name = link.GetAttribute("name");
+ if (string.IsNullOrEmpty(gb))
+ {
+ link.SetAttribute("gb", "gecko_link" + linkNumber);
+ }
+ if (string.IsNullOrEmpty(id))
+ {
+ link.SetAttribute("id", "gb" + linkNumber);
+ id = "gb" + linkNumber;
+ }
+ }
+
private void webBrowser_DocumentCompleted(object sender, EventArgs e)
{
MyLog.debug("page completed : " + webBrowser.Url.ToString());
@@ -936,22 +951,15 @@
};
if (!element.InnerHtml.Contains("gecko_id"))
{
+ GeckoElement ls = element;
+ while (ls.LastChild != null && ls.LastChild is GeckoElement && !String.IsNullOrEmpty(ls.LastChild.TextContent))
+ ls = (GeckoElement)ls.LastChild;
insertSpan(i, String.Empty, "LINK", lastSpan.ClassName,
- element.LastChild == null ? element : element.LastChild);
+ ls);
}
- string gb = element.GetAttribute("gb");
- string id = element.GetAttribute("id");
- string name = element.GetAttribute("name");
- if (string.IsNullOrEmpty(gb))
- {
- element.SetAttribute("gb", "gecko_link" + i);
- }
- if (string.IsNullOrEmpty(id))
- {
- element.SetAttribute("id", "gb" + i);
- id = "gb" + i;
- }
+ string id, name;
+ SetLinkAttributes(element, i, out id, out name);
_htmlLinkNumbers.Add(i, new HtmlLinkNumber(i, id, name, link, HtmlInputType.Link));
i++;
}
@@ -972,23 +980,12 @@
{
if (linkType != "hidden")
{
+ string id, name;
+ SetLinkAttributes(link, i, out id, out name);
- string gb = link.GetAttribute("gb");
- string id = link.GetAttribute("id");
- string name = link.GetAttribute("name");
- if (string.IsNullOrEmpty(gb))
- {
- link.SetAttribute("gb", "gecko_link" + i);
- }
- if (string.IsNullOrEmpty(id))
- {
- link.SetAttribute("id", "gb" + i);
- id = "gb" + i;
- }
-
if (!element.InnerHtml.Contains("gecko_id=\"" + i + "\""))
{
- insertSpan(i, action, "INPUT", null, link);
+ insertSpan(i, action, "INPUT", null, link.Parent);
}
if (linkType == "submit" ||
linkType == "reset" ||
@@ -1010,22 +1007,12 @@
}
else
{
- string gb = link.GetAttribute("gb");
- string id = link.GetAttribute("id");
- string name = link.GetAttribute("name");
- if (string.IsNullOrEmpty(gb))
- {
- link.SetAttribute("gb", "gecko_link" + i);
- }
- if (string.IsNullOrEmpty(id))
- {
- link.SetAttribute("id", "gb" + i);
- id = "gb" + i;
- }
+ string id, name;
+ SetLinkAttributes(link, i, out id, out name);
if (!element.InnerHtml.Contains("gecko_id=\"" + i + "\""))
{
- insertSpan(i, action, "INPUT", null, link);
+ insertSpan(i, action, "INPUT", null, link.Parent);
}
_htmlLinkNumbers.Add(i, new HtmlLinkNumber(i, id, name, action, HtmlInputType.Input));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2012-04-20 18:54:50
|
Revision: 4484
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4484&view=rev
Author: doskabouter
Date: 2012-04-20 18:54:44 +0000 (Fri, 20 Apr 2012)
Log Message:
-----------
better cleanup
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2012-04-17 21:16:38 UTC (rev 4483)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2012-04-20 18:54:44 UTC (rev 4484)
@@ -74,8 +74,8 @@
public static string Parameter = string.Empty;
public static string loadFav = string.Empty;
+ private bool originalMouseSupport;
-
#endregion
#region ISetupForm Member
@@ -229,6 +229,7 @@
if (settings.UseMouse)
{
MyLog.debug("Mouse support is enabled");
+ originalMouseSupport = GUIGraphicsContext.MouseSupport;
GUIGraphicsContext.MouseSupport = true;
Cursor.Show();
}
@@ -332,11 +333,15 @@
webBrowser.DocumentCompleted -= new EventHandler(webBrowser_DocumentCompleted);
webBrowser.StatusTextChanged -= new EventHandler(webBrowser_StatusTextChanged);
webBrowser.DomKeyDown -= new GeckoDomKeyEventHandler(webBrowser_DomKeyDown);
+ webBrowser.DomClick -= new GeckoDomEventHandler(webBrowser_DomClick);
timer.Tick -= new EventHandler(timer_Tick);
timer.Stop();
if (settings.UseMouse)
+ {
Cursor.Hide();
+ GUIGraphicsContext.MouseSupport = originalMouseSupport;
+ }
base.OnPageDestroy(new_windowId);
}
@@ -417,7 +422,7 @@
else
GUIPropertyManager.SetProperty("#btWeb.status", DateTime.Now.ToLongTimeString() + " : " +
action.wID.ToString() + " / " + action.m_key.KeyChar.ToString());
- }
+ }
#endregion
#region selectable buttons
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2012-07-08 20:58:51
|
Revision: 4498
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4498&view=rev
Author: doskabouter
Date: 2012-07-08 20:58:45 +0000 (Sun, 08 Jul 2012)
Log Message:
-----------
fixed pageup/pagedown when zoom is not 100%
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2012-07-07 18:41:12 UTC (rev 4497)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2012-07-08 20:58:45 UTC (rev 4498)
@@ -795,7 +795,7 @@
{
if (!mouseVisible)
{
- int height = webBrowser.Size.Height;
+ int height = Convert.ToInt32((float)webBrowser.Size.Height / zoom);
if (webBrowser.Window != null) ScrollTo(webBrowser.Window.ScrollX, webBrowser.Window.ScrollY - height + 100);
}
else
@@ -808,7 +808,7 @@
{
if (!mouseVisible)
{
- int height = webBrowser.Size.Height;
+ int height = Convert.ToInt32((float)webBrowser.Size.Height / zoom);
if (webBrowser.Window != null) ScrollTo(webBrowser.Window.ScrollX, webBrowser.Window.ScrollY + height - 100);
}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2012-07-28 18:41:11
|
Revision: 4507
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4507&view=rev
Author: doskabouter
Date: 2012-07-28 18:41:05 +0000 (Sat, 28 Jul 2012)
Log Message:
-----------
Fixed missing cursor in fullscreen-mouse mode
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2012-07-26 21:25:33 UTC (rev 4506)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2012-07-28 18:41:05 UTC (rev 4507)
@@ -264,7 +264,7 @@
MyLog.debug("Mouse support is enabled");
originalMouseSupport = GUIGraphicsContext.MouseSupport;
GUIGraphicsContext.MouseSupport = true;
- Cursor.Show();
+ while (ShowCursor(true) < 0) ;
}
Parameter = null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2013-03-14 22:20:25
|
Revision: 4545
http://sourceforge.net/p/mp-plugins/code/4545
Author: doskabouter
Date: 2013-03-14 22:20:22 +0000 (Thu, 14 Mar 2013)
Log Message:
-----------
- ClearCachedCOMPtrs not needed anymore
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2013-03-14 22:18:57 UTC (rev 4544)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2013-03-14 22:20:22 UTC (rev 4545)
@@ -291,7 +291,7 @@
webBrowser.Visible = true;
webBrowser.Enabled = settings.UseMouse;
- webBrowser.ClearCachedCOMPtrs();
+ //webBrowser.ClearCachedCOMPtrs();possibly not needed anymore
webBrowser.Dock = DockStyle.None;
SetBrowserWindow();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2013-04-07 21:55:41
|
Revision: 4560
http://sourceforge.net/p/mp-plugins/code/4560
Author: doskabouter
Date: 2013-04-07 21:55:39 +0000 (Sun, 07 Apr 2013)
Log Message:
-----------
fixed threading issue at startuo
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2013-04-07 19:47:28 UTC (rev 4559)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2013-04-07 21:55:39 UTC (rev 4560)
@@ -74,11 +74,11 @@
private float zoom = Settings.Instance.DefaultZoom;
private Settings settings = Settings.Instance;
- public static bool ParameterSupported = false;
public static string Parameter = string.Empty;
public static string loadFav = string.Empty;
private bool originalMouseSupport;
+ private bool formsAdded = false;
#endregion
@@ -165,21 +165,6 @@
{
MyLog.debug("Init Browse the web");
- AddFormsDelegate d = AddForms;
- GUIGraphicsContext.form.Invoke(d);
-
- #region parameters test
- ParameterSupported = false;
- if (typeof(GUIWindow).GetField("_loadParameter", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance) != null)
- {
- ParameterSupported = true;
- }
- #endregion
-
- TrySetProxy();
- if (!String.IsNullOrEmpty(settings.UserAgent))
- GeckoPreferences.User["general.useragent.override"] = settings.UserAgent;
-
BookmarkXml.AddFolder(Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) +
"\\bookmarks.xml", "Saved by MP");
@@ -188,10 +173,11 @@
return Load(GUIGraphicsContext.Skin + @"\BrowseTheWeb.xml");
}
- private delegate void AddFormsDelegate();
-
private void AddForms()
{
+ if (formsAdded)
+ return;
+ MyLog.debug("Start AddForms");
try
{
Xpcom.Initialize(Settings.XulRunnerPath());
@@ -219,6 +205,12 @@
GeckoPreferences.Load(preferenceFile);
#endregion
+ TrySetProxy();
+ if (!String.IsNullOrEmpty(settings.UserAgent))
+ GeckoPreferences.User["general.useragent.override"] = settings.UserAgent;
+
+ formsAdded = true;
+ MyLog.debug("Finish AddForms");
}
private void SetBrowserWindow()
@@ -255,6 +247,7 @@
protected override void OnPageLoad()
{
+ AddForms();
GUIPropertyManager.SetProperty("#currentmodule", settings.PluginName);
if (settings.DisableAero && !aeroDisabled)
@@ -281,11 +274,7 @@
while (ShowCursor(true) < 0) ;
}
- Parameter = null;
- if (ParameterSupported)
- {
- Parameter = _loadParameter;
- }
+ Parameter = _loadParameter;
#region init browser
webBrowser.Visible = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2013-04-15 20:15:43
|
Revision: 4562
http://sourceforge.net/p/mp-plugins/code/4562
Author: doskabouter
Date: 2013-04-15 20:15:38 +0000 (Mon, 15 Apr 2013)
Log Message:
-----------
fixed click issue when zoom isn't 100%
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2013-04-08 19:35:21 UTC (rev 4561)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2013-04-15 20:15:38 UTC (rev 4562)
@@ -1000,7 +1000,8 @@
{
Point p = DomHelper.GetCenterCoordinate(webBrowser.Document, ge);
MyLog.debug("perform click on " + p.ToString());
-
+ p.X = Convert.ToInt32(p.X * zoom);
+ p.Y = Convert.ToInt32(p.Y * zoom);
webBrowser.Enabled = true;
System.Threading.Thread.Sleep(200);
Cursor.Position = webBrowser.PointToScreen(p);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2013-07-04 20:59:14
|
Revision: 4596
http://sourceforge.net/p/mp-plugins/code/4596
Author: doskabouter
Date: 2013-07-04 20:59:11 +0000 (Thu, 04 Jul 2013)
Log Message:
-----------
Fixed some gui issues: briefly flash the desktop, and briefly show a black rectangle at top-left
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2013-07-02 19:53:18 UTC (rev 4595)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2013-07-04 20:59:11 UTC (rev 4596)
@@ -192,14 +192,14 @@
webBrowser = new GeckoWebBrowser();
webBrowser.Name = "BrowseTheWeb";
webBrowser.NoDefaultContextMenu = true;
-
- GUIGraphicsContext.form.Controls.Add(webBrowser);
webBrowser.Enabled = false;
webBrowser.Visible = false;
+ GUIGraphicsContext.form.Controls.Add(webBrowser);
+
osd_linkID = new OSD_LinkId();
+ osd_linkID.Visible = false;
GUIGraphicsContext.form.Controls.Add(osd_linkID);
- osd_linkID.Visible = false;
string preferenceFile = Path.Combine(Config.GetFolder(Config.Dir.Config), "btwebprefs.js");
if (File.Exists(preferenceFile))
GeckoPreferences.Load(preferenceFile);
@@ -277,14 +277,15 @@
Parameter = _loadParameter;
#region init browser
+
+ webBrowser.Dock = DockStyle.None;
+ SetBrowserWindow();
+
webBrowser.Visible = true;
webBrowser.Enabled = settings.UseMouse;
webBrowser.ClearCachedCOMPtrs();
- webBrowser.Dock = DockStyle.None;
- SetBrowserWindow();
-
MyLog.debug("Create eventhandler");
webBrowser.DocumentCompleted += new EventHandler(webBrowser_DocumentCompleted);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2013-07-05 20:44:21
|
Revision: 4597
http://sourceforge.net/p/mp-plugins/code/4597
Author: doskabouter
Date: 2013-07-05 20:44:18 +0000 (Fri, 05 Jul 2013)
Log Message:
-----------
minor cleanup
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2013-07-04 20:59:11 UTC (rev 4596)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2013-07-05 20:44:18 UTC (rev 4597)
@@ -308,23 +308,30 @@
}
string loadFav = StartupLink;
-
- if (String.IsNullOrEmpty(webBrowser.Document.Domain))
+ if (!String.IsNullOrEmpty(loadFav))
{
- if ((settings.UseHome) && (string.IsNullOrEmpty(loadFav)))
- {
- webBrowser.Navigate(settings.HomePage);
- MyLog.debug("load home page " + settings.HomePage);
- }
- }
-
- if (!string.IsNullOrEmpty(loadFav))
- {
webBrowser.Navigate(loadFav);
MyLog.debug("load favorite " + loadFav);
StartupLink = string.Empty;
}
+ else
+ {
+ if (String.IsNullOrEmpty(webBrowser.Document.Domain))
+ {
+ if (settings.UseHome)
+ {
+ webBrowser.Navigate(settings.HomePage);
+ MyLog.debug("load home page " + settings.HomePage);
+ }
+ else
+ {
+ webBrowser.Navigate("about:blank");
+ MyLog.debug("load about:blank");
+ }
+ }
+ }
+
#endregion
osd_linkID.Location = new System.Drawing.Point((GUIGraphicsContext.form.Width / 2) - (osd_linkID.Width / 2),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2014-01-19 12:35:35
|
Revision: 4747
http://sourceforge.net/p/mp-plugins/code/4747
Author: doskabouter
Date: 2014-01-19 12:35:31 +0000 (Sun, 19 Jan 2014)
Log Message:
-----------
Fixed mouse visibility bug
minor cleanup
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-01-19 12:31:57 UTC (rev 4746)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-01-19 12:35:31 UTC (rev 4747)
@@ -31,6 +31,7 @@
using MediaPortal.Dialogs;
using MediaPortal.Configuration;
+using System.Reflection;
using System.Windows.Forms;
using System.Runtime.InteropServices;
@@ -44,7 +45,7 @@
public class GUIPlugin : GUIWindow, ISetupForm
{
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
- public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);
+ public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, IntPtr dwExtraInfo);
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern int ShowCursor(bool bShow);
[DllImport("dwmapi.dll", EntryPoint = "DwmEnableComposition")]
@@ -78,6 +79,7 @@
public static string loadFav = string.Empty;
private bool originalMouseSupport;
+ private bool originalMouseAutoHide;
private bool formsAdded = false;
#endregion
@@ -266,6 +268,9 @@
originalMouseSupport = GUIGraphicsContext.MouseSupport;
GUIGraphicsContext.MouseSupport = true;
while (ShowCursor(true) < 0) ;
+ FieldInfo fi = GUIGraphicsContext.form.GetType().GetField("AutoHideMouse", BindingFlags.NonPublic | BindingFlags.Instance);
+ originalMouseAutoHide = (bool)fi.GetValue(GUIGraphicsContext.form);
+ fi.SetValue(GUIGraphicsContext.form, false);
}
Parameter = _loadParameter;
@@ -492,7 +497,7 @@
clickFromPlugin = true;
int X = Cursor.Position.X;
int Y = Cursor.Position.Y;
- mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
+ mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, IntPtr.Zero);
}
}
if (action.wID == settings.Remote_Bookmark)
@@ -932,7 +937,7 @@
#endregion
if (logHtml)
{
- using (System.IO.StreamWriter tw = new System.IO.StreamWriter(@"e:\last.html"))
+ using (System.IO.StreamWriter tw = new System.IO.StreamWriter(@"d:\last.html"))
{
tw.WriteLine(((GeckoHtmlElement)webBrowser.Document.DocumentElement).OuterHtml);
}
@@ -1008,7 +1013,7 @@
System.Threading.Thread.Sleep(200);
Cursor.Position = webBrowser.PointToScreen(p);
clickFromPlugin = true;
- mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
+ mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, IntPtr.Zero);
}
//else
// ge.Click();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2014-01-19 12:38:04
|
Revision: 4748
http://sourceforge.net/p/mp-plugins/code/4748
Author: doskabouter
Date: 2014-01-19 12:38:02 +0000 (Sun, 19 Jan 2014)
Log Message:
-----------
minor cleanup
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-01-19 12:35:31 UTC (rev 4747)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-01-19 12:38:02 UTC (rev 4748)
@@ -557,7 +557,7 @@
GUIGraphicsContext.form.Cursor = new Cursor(memoryStream);
}
mouseVisible = true;
- while (ShowCursor(true) < 0) ;
+ while (ShowCursor(true) < 0);
}
}
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2014-01-23 21:37:13
|
Revision: 4752
http://sourceforge.net/p/mp-plugins/code/4752
Author: doskabouter
Date: 2014-01-23 21:37:10 +0000 (Thu, 23 Jan 2014)
Log Message:
-----------
Improved mouse click emulation
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-01-23 20:59:24 UTC (rev 4751)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-01-23 21:37:10 UTC (rev 4752)
@@ -45,9 +45,27 @@
public class GUIPlugin : GUIWindow, ISetupForm
{
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct MOUSEINPUT
+ {
+ public int X;
+ public int Y;
+ public uint MouseData;
+ public uint Flags;
+ public uint Time;
+ public IntPtr ExtraInfo;
+ }
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct INPUT
+ {
+ public uint Type;
+ public MOUSEINPUT Mouse;
+ }
+
+ [DllImport("user32.dll", SetLastError = true)]
+ private static extern uint SendInput(uint numberOfInputs, INPUT[] inputs, int sizeOfInputStructure);
+
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
- public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, IntPtr dwExtraInfo);
- [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern int ShowCursor(bool bShow);
[DllImport("dwmapi.dll", EntryPoint = "DwmEnableComposition")]
protected extern static uint Win32DwmEnableComposition(uint uCompositionAction);
@@ -492,12 +510,7 @@
}
else
{
- webBrowser.Enabled = true;
- System.Threading.Thread.Sleep(200);
- clickFromPlugin = true;
- int X = Cursor.Position.X;
- int Y = Cursor.Position.Y;
- mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, IntPtr.Zero);
+ ClickOn(null);
}
}
if (action.wID == settings.Remote_Bookmark)
@@ -982,19 +995,35 @@
// some items just need a mousehover, and a ge.Click won't do that
{
Point p = DomHelper.GetCenterCoordinate(webBrowser.Document, ge);
- MyLog.debug("perform click on " + p.ToString());
p.X = Convert.ToInt32(p.X * zoom);
p.Y = Convert.ToInt32(p.Y * zoom);
- webBrowser.Enabled = true;
- System.Threading.Thread.Sleep(200);
- Cursor.Position = webBrowser.PointToScreen(p);
- clickFromPlugin = true;
- mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, IntPtr.Zero);
+ ClickOn(p);
}
//else
// ge.Click();
}
+ private int delta = 5;
+ private void ClickOn(Point? p)
+ {
+ webBrowser.Enabled = true;
+ if (p.HasValue)
+ {
+ Point newP = new Point(p.Value.X + delta, p.Value.Y);
+ delta = -delta;// some flash vids don't react to clicking on previous coordinate
+ MyLog.debug("perform click on " + newP.ToString());
+ Cursor.Position = webBrowser.PointToScreen(newP);
+ }
+
+ INPUT[] ips = new INPUT[] { new INPUT { Type = 0 }, new INPUT { Type = 0 } };
+ ips[0].Mouse.Flags = MOUSEEVENTF_LEFTDOWN;
+ ips[1].Mouse.Flags = MOUSEEVENTF_LEFTUP;
+
+ clickFromPlugin = true;
+ if (SendInput(2, ips, Marshal.SizeOf(typeof(INPUT))) == 0)
+ MyLog.debug("Error sendinput");
+ }
+
public void ShowInputDialog(bool isPassword, GeckoInputElement element)
{
webBrowser.Visible = false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2014-03-03 14:27:54
|
Revision: 4769
http://sourceforge.net/p/mp-plugins/code/4769
Author: doskabouter
Date: 2014-03-03 14:27:50 +0000 (Mon, 03 Mar 2014)
Log Message:
-----------
Improved error logging
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-03-01 18:05:25 UTC (rev 4768)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-03-03 14:27:50 UTC (rev 4769)
@@ -199,7 +199,7 @@
}
catch (Exception ex)
{
- MyLog.debug("Could not find xulrunner under : " + Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) + "\\xulrunner");
+ MyLog.debug("Could not find xulrunner under : " + Settings.XulRunnerPath());
MyLog.debug("Reason : " + ex.Message);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2014-08-25 20:29:29
|
Revision: 4875
http://sourceforge.net/p/mp-plugins/code/4875
Author: doskabouter
Date: 2014-08-25 20:29:27 +0000 (Mon, 25 Aug 2014)
Log Message:
-----------
Minor cleanup
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-08-18 19:59:48 UTC (rev 4874)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-08-25 20:29:27 UTC (rev 4875)
@@ -388,10 +388,10 @@
osd_linkID.Visible = false;
- webBrowser.DocumentCompleted -= new EventHandler(webBrowser_DocumentCompleted);
- webBrowser.StatusTextChanged -= new EventHandler(webBrowser_StatusTextChanged);
- webBrowser.DomKeyDown -= new EventHandler<DomKeyEventArgs>(webBrowser_DomKeyDown);
- webBrowser.DomClick -= new EventHandler<DomEventArgs>(webBrowser_DomClick);
+ webBrowser.DocumentCompleted -= webBrowser_DocumentCompleted;
+ webBrowser.StatusTextChanged -= webBrowser_StatusTextChanged;
+ webBrowser.DomKeyDown -= webBrowser_DomKeyDown;
+ webBrowser.DomClick -= webBrowser_DomClick;
timer.Tick -= new EventHandler(timer_Tick);
timer.Stop();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2014-08-25 20:30:53
|
Revision: 4876
http://sourceforge.net/p/mp-plugins/code/4876
Author: doskabouter
Date: 2014-08-25 20:30:49 +0000 (Mon, 25 Aug 2014)
Log Message:
-----------
Minor cleanup
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-08-25 20:29:27 UTC (rev 4875)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-08-25 20:30:49 UTC (rev 4876)
@@ -393,7 +393,7 @@
webBrowser.DomKeyDown -= webBrowser_DomKeyDown;
webBrowser.DomClick -= webBrowser_DomClick;
- timer.Tick -= new EventHandler(timer_Tick);
+ timer.Tick -= timer_Tick;
timer.Stop();
if (settings.UseMouse)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2014-08-25 20:47:32
|
Revision: 4877
http://sourceforge.net/p/mp-plugins/code/4877
Author: doskabouter
Date: 2014-08-25 20:47:24 +0000 (Mon, 25 Aug 2014)
Log Message:
-----------
Minor cleanup
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-08-25 20:30:49 UTC (rev 4876)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-08-25 20:47:24 UTC (rev 4877)
@@ -39,6 +39,8 @@
using Gecko.Collections;
using Gecko.DOM;
+using Action = MediaPortal.GUI.Library.Action;
+
namespace BrowseTheWeb
{
[PluginIcons("BrowseTheWeb.xulrunner.png", "BrowseTheWeb.xulrunnerOff.png")]
@@ -474,13 +476,13 @@
base.OnPreviousWindow();
}
- public override void OnAction(MediaPortal.GUI.Library.Action action)
+ public override void OnAction(Action action)
{
GUIPropertyManager.SetProperty("#btWeb.linkid", String.IsNullOrEmpty(linkId) ? String.Empty : "Link ID = " + linkId);
#region remote diagnostic
if (settings.Remote)
{
- if (action.wID != MediaPortal.GUI.Library.Action.ActionType.ACTION_KEY_PRESSED)
+ if (action.wID != Action.ActionType.ACTION_KEY_PRESSED)
GUIPropertyManager.SetProperty("#btWeb.status", DateTime.Now.ToLongTimeString() + " : " +
action.wID.ToString());
else
@@ -519,12 +521,12 @@
return;
}
if ((action.wID == settings.Remote_Zoom_In) ||
- (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_MUSIC_FORWARD))
+ (action.wID == Action.ActionType.ACTION_MUSIC_FORWARD))
{
OnZoomIn();
}
if ((action.wID == settings.Remote_Zoom_Out) ||
- (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_MUSIC_REWIND))
+ (action.wID == Action.ActionType.ACTION_MUSIC_REWIND))
{
OnZoomOut();
}
@@ -545,17 +547,17 @@
switch (action.wID)
{
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOUSE_CLICK:
+ case Action.ActionType.ACTION_MOUSE_CLICK:
{
break;
}
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOUSE_MOVE:
+ case Action.ActionType.ACTION_MOUSE_MOVE:
if (settings.UseMouse)
{
}
break;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_NEXT_SUBTITLE:
+ case Action.ActionType.ACTION_NEXT_SUBTITLE:
if (!settings.UseMouse)
{
if (mouseVisible)
@@ -574,7 +576,7 @@
}
}
break;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_KEY_PRESSED:
+ case Action.ActionType.ACTION_KEY_PRESSED:
if (!settings.UseMouse)
{
linkTime = 0;
@@ -599,52 +601,52 @@
if (linkId.Length > 4) linkId = linkId.Substring(0, 1);
}
break;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU:
+ case Action.ActionType.ACTION_PREVIOUS_MENU:
linkId = string.Empty;
break;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_PLAY:
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_MUSIC_PLAY:
+ case Action.ActionType.ACTION_PLAY:
+ case Action.ActionType.ACTION_MUSIC_PLAY:
OnEnterNewLink();
return;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAUSE:
+ case Action.ActionType.ACTION_PAUSE:
webBrowser.Navigate(settings.HomePage);
MyLog.debug("load home page " + settings.HomePage);
if (!settings.Remote) GUIPropertyManager.SetProperty("#btWeb.status", "go to homepage");
return;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_STOP:
+ case Action.ActionType.ACTION_STOP:
webBrowser.Navigate("about:blank");
if (!settings.Remote) GUIPropertyManager.SetProperty("#btWeb.status", "Stop");
return;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_PREV_ITEM:
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_REWIND:
+ case Action.ActionType.ACTION_PREV_ITEM:
+ case Action.ActionType.ACTION_REWIND:
webBrowser.GoBack();
if (!settings.Remote) GUIPropertyManager.SetProperty("#btWeb.status", "go backward");
MyLog.debug("navigate go back");
return;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_NEXT_ITEM:
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_FORWARD:
+ case Action.ActionType.ACTION_NEXT_ITEM:
+ case Action.ActionType.ACTION_FORWARD:
webBrowser.GoForward();
if (!settings.Remote) GUIPropertyManager.SetProperty("#btWeb.status", "go forward");
MyLog.debug("navigate go forward");
return;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_RECORD:
+ case Action.ActionType.ACTION_RECORD:
OnAddBookmark();
return;
#region move
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_RIGHT:
+ case Action.ActionType.ACTION_MOVE_RIGHT:
OnMoveRight();
return;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_LEFT:
+ case Action.ActionType.ACTION_MOVE_LEFT:
OnMoveLeft();
return;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_UP:
+ case Action.ActionType.ACTION_MOVE_UP:
OnMoveUp();
return;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_DOWN:
+ case Action.ActionType.ACTION_MOVE_DOWN:
OnMoveDown();
return;
- case MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM:
+ case Action.ActionType.ACTION_SELECT_ITEM:
return;
#endregion
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2014-09-22 21:28:56
|
Revision: 4881
http://sourceforge.net/p/mp-plugins/code/4881
Author: doskabouter
Date: 2014-09-22 21:28:48 +0000 (Mon, 22 Sep 2014)
Log Message:
-----------
Fixed focus issues
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-09-22 21:21:23 UTC (rev 4880)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-09-22 21:28:48 UTC (rev 4881)
@@ -91,6 +91,7 @@
private string linkId = string.Empty;
private int linkTime = 0;
private Timer timer = new Timer();
+ private Timer restoreClickTimer = new Timer();
private string lastDomain = string.Empty;
private float zoom = Settings.Instance.DefaultZoom;
@@ -360,6 +361,10 @@
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
+ restoreClickTimer.Enabled = false;
+ restoreClickTimer.Interval = 500;
+ restoreClickTimer.Tick += new EventHandler(restoreClickTimer_Tick);
+
if (settings.UseMouse)
webBrowser.Select();
}
@@ -397,10 +402,14 @@
timer.Tick -= timer_Tick;
timer.Stop();
+ restoreClickTimer.Stop();
+ restoreClickTimer.Tick -= restoreClickTimer_Tick;
if (settings.UseMouse)
{
Cursor.Hide();
GUIGraphicsContext.MouseSupport = originalMouseSupport;
+ FieldInfo fi = GUIGraphicsContext.form.GetType().GetField("AutoHideMouse", BindingFlags.NonPublic | BindingFlags.Instance);
+ fi.SetValue(GUIGraphicsContext.form, originalMouseAutoHide);
}
base.OnPageDestroy(new_windowId);
}
@@ -684,16 +693,27 @@
}
}
+
+ void ResetFocus()
+ {
+ clickFromPlugin = false;
+ restoreClickTimer.Stop();
+
+ webBrowser.Enabled = false;
+ GUIGraphicsContext.form.Focus();
+ }
+
void webBrowser_DomClick(object sender, DomEventArgs e)
{
if (clickFromPlugin) // click succeeded, so focus can safely be reset
- {
- clickFromPlugin = false;
- webBrowser.Enabled = false;
- GUIGraphicsContext.form.Focus();
- }
+ ResetFocus();
}
+ void restoreClickTimer_Tick(object sender, EventArgs e)
+ {
+ ResetFocus();
+ }
+
private void OnEnterNewLink()
{
webBrowser.Visible = false;
@@ -1000,6 +1020,7 @@
ips[1].Mouse.Flags = MOUSEEVENTF_LEFTUP;
clickFromPlugin = true;
+ restoreClickTimer.Start();
if (SendInput(2, ips, Marshal.SizeOf(typeof(INPUT))) == 0)
MyLog.debug("Error sendinput");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dos...@us...> - 2014-09-22 21:36:21
|
Revision: 4882
http://sourceforge.net/p/mp-plugins/code/4882
Author: doskabouter
Date: 2014-09-22 21:36:13 +0000 (Mon, 22 Sep 2014)
Log Message:
-----------
Unified responses to keypresses
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-09-22 21:28:48 UTC (rev 4881)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2014-09-22 21:36:13 UTC (rev 4882)
@@ -666,31 +666,22 @@
{
if (settings.UseMouse || mouseVisible)
{
- //System.Diagnostics.Debug.WriteLine("DOM " + e.KeyCode.ToString());
-
- if (e.KeyCode == (uint)Keys.Escape)
- GUIWindowManager.ShowPreviousWindow();
-
- if (e.KeyCode == (uint)Keys.PageUp) OnZoomIn();
- if (e.KeyCode == (uint)Keys.PageDown) OnZoomOut();
-
- if (e.KeyCode == (uint)Keys.Down) OnMoveDown();
- if (e.KeyCode == (uint)Keys.Up) OnMoveUp();
- if (e.KeyCode == (uint)Keys.Left) OnMoveLeft();
- if (e.KeyCode == (uint)Keys.Right) OnMoveRight();
-
- if (e.KeyCode == (uint)Keys.F3) GUIWindowManager.ActivateWindow(GUIBookmark.BookmarkWindowId);
-
- if (e.KeyCode == (uint)Keys.F7) webBrowser.GoBack();
- if (e.KeyCode == (uint)Keys.F8) webBrowser.GoForward();
-
- if (e.CtrlKey == true)
+ GeckoHtmlElement element = webBrowser.Document.ActiveElement;
+ bool keyIsChar = e.KeyCode >= 65 && (e.KeyCode <= 90);
+ if (keyIsChar && ((element is GeckoInputElement) || (element is GeckoTextAreaElement)))
+ { }//user is typing text, so don't convert to MediaPortal.GUI.Library.Action
+ else
{
- if (e.KeyCode == (uint)Keys.R) OnAddBookmark();
- if (e.KeyCode == (uint)Keys.P) OnEnterNewLink();
- if (e.KeyCode == (uint)Keys.B) webBrowser.Navigate("about:blank");
+ Action action = new Action();
+ Key key;
+ //Uppercase keys (f.e. Record=R) isn't recognized, so hack to get mp to find the correct action
+ if (keyIsChar)
+ key = new Key((int)e.KeyCode + 32, 0);
+ else
+ key = new Key((int)e.KeyChar, (int)e.KeyCode);
+ if (ActionTranslator.GetAction(-1, key, ref action) && action.wID != Action.ActionType.ACTION_INVALID)
+ OnAction(action);
}
-
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|