diff --git a/SafeExamBrowser.Browser.Contracts/Events/TabPressedEventHandler.cs b/SafeExamBrowser.Browser.Contracts/Events/TabPressedEventHandler.cs
new file mode 100644
index 00000000..f9586a6c
--- /dev/null
+++ b/SafeExamBrowser.Browser.Contracts/Events/TabPressedEventHandler.cs
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2022 ETH Zürich, Educational Development and Technology (LET)
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+namespace SafeExamBrowser.Browser.Contracts.Events
+{
+ ///
+ /// Event handler used to indicate that the user pressed the tab key to move the focus forward or backward.
+ ///
+ public delegate void TabPressedEventHandler(bool forward);
+}
diff --git a/SafeExamBrowser.Browser.Contracts/SafeExamBrowser.Browser.Contracts.csproj b/SafeExamBrowser.Browser.Contracts/SafeExamBrowser.Browser.Contracts.csproj
index 7404735e..02460564 100644
--- a/SafeExamBrowser.Browser.Contracts/SafeExamBrowser.Browser.Contracts.csproj
+++ b/SafeExamBrowser.Browser.Contracts/SafeExamBrowser.Browser.Contracts.csproj
@@ -57,6 +57,7 @@
+
diff --git a/SafeExamBrowser.Browser/BrowserWindow.cs b/SafeExamBrowser.Browser/BrowserWindow.cs
index 53ce3aba..bf94af95 100644
--- a/SafeExamBrowser.Browser/BrowserWindow.cs
+++ b/SafeExamBrowser.Browser/BrowserWindow.cs
@@ -702,7 +702,7 @@ namespace SafeExamBrowser.Browser
}
}
- private void TabPressed(object sender, bool shiftPressed)
+ private void TabPressed(bool shiftPressed)
{
this.Control.ExecuteJavascript("document.activeElement.tagName", result =>
{
diff --git a/SafeExamBrowser.Browser/Handlers/KeyboardHandler.cs b/SafeExamBrowser.Browser/Handlers/KeyboardHandler.cs
index e7b48563..aae93188 100644
--- a/SafeExamBrowser.Browser/Handlers/KeyboardHandler.cs
+++ b/SafeExamBrowser.Browser/Handlers/KeyboardHandler.cs
@@ -8,6 +8,7 @@
using System.Windows.Forms;
using CefSharp;
+using SafeExamBrowser.Browser.Contracts.Events;
using SafeExamBrowser.UserInterface.Contracts;
namespace SafeExamBrowser.Browser.Handlers
@@ -21,7 +22,7 @@ namespace SafeExamBrowser.Browser.Handlers
internal event ActionRequestedEventHandler ZoomOutRequested;
internal event ActionRequestedEventHandler ZoomResetRequested;
internal event ActionRequestedEventHandler FocusAddressBarRequested;
- internal event System.EventHandler TabPressed;
+ internal event TabPressedEventHandler TabPressed;
private int? currentKeyDown = null;
@@ -64,7 +65,7 @@ namespace SafeExamBrowser.Browser.Handlers
if (keyCode == (int)Keys.Tab && keyCode == currentKeyDown)
{
- TabPressed?.Invoke(this, shift);
+ TabPressed?.Invoke(shift);
}
}