Skip to content

Commit

Permalink
Enhanced key mappings in AutomationExtensions
Browse files Browse the repository at this point in the history
Added comprehensive key mappings for special keys and functions in AutomationExtensions.cs, significantly enhancing keyboard interaction capabilities. This update includes mappings for keys such as Null, Cancel, Help, and various system and function keys, covering a wide range of keyboard interactions.

Additionally, fixed a syntax error in the Delete key mapping to ensure proper dictionary initialization.

In ActionsController.cs, removed unused `using` directives for `System.Text.Json` and `Uia.DriverServer.Domain`, indicating a shift in JSON handling and a potential reorganization of namespaces and dependencies within the project.
  • Loading branch information
gravity-api committed Jul 1, 2024
1 parent e3a57fd commit 271246c
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
58 changes: 57 additions & 1 deletion src/Uia.DriverServer.Extensions/AutomationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,63 @@ public static class AutomationExtensions
["Down"] = 0x50, // Down arrow key
["PgDn"] = 0x51, // Page Down key
["Ins"] = 0x52, // Insert key
["Del"] = 0x53 // Delete key
["Del"] = 0x53, // Delete key
["\uE000"] = 0x01, // Null
["\uE001"] = 0x02, // Cancel
["\uE002"] = 0x03, // Help
["\uE003"] = 0x0E, // Backspace
["\uE004"] = 0x0F, // Tab
["\uE005"] = 0x04, // Clear
["\uE006"] = 0x1C, // Return
["\uE007"] = 0x1C, // Enter
["\uE008"] = 0x2A, // Shift
["\uE009"] = 0x1D, // Control
["\uE00A"] = 0x38, // Alt
["\uE00B"] = 0x39, // Pause
["\uE00C"] = 0x01, // Escape
["\uE00D"] = 0x39, // Space
["\uE00E"] = 0x49, // PageUp
["\uE00F"] = 0x51, // PageDown
["\uE010"] = 0x4F, // End
["\uE011"] = 0x47, // Home
["\uE012"] = 0x4B, // Left / ArrowLeft
["\uE013"] = 0x48, // Up / ArrowUp
["\uE014"] = 0x4D, // Right / ArrowRight
["\uE015"] = 0x50, // Down / ArrowDown
["\uE016"] = 0x52, // Insert
["\uE017"] = 0x53, // Delete
["\uE018"] = 0x27, // Semicolon
["\uE019"] = 0x0D, // Equal
["\uE01A"] = 0x52, // NumberPad0
["\uE01B"] = 0x4F, // NumberPad1
["\uE01C"] = 0x50, // NumberPad2
["\uE01D"] = 0x51, // NumberPad3
["\uE01E"] = 0x4B, // NumberPad4
["\uE01F"] = 0x4C, // NumberPad5
["\uE020"] = 0x4D, // NumberPad6
["\uE021"] = 0x47, // NumberPad7
["\uE022"] = 0x48, // NumberPad8
["\uE023"] = 0x49, // NumberPad9
["\uE024"] = 0x37, // Multiply
["\uE025"] = 0x4E, // Add
["\uE026"] = 0x04, // Separator
["\uE027"] = 0x4A, // Subtract
["\uE028"] = 0x53, // Decimal
["\uE029"] = 0x35, // Divide
["\uE031"] = 0x3B, // F1
["\uE032"] = 0x3C, // F2
["\uE033"] = 0x3D, // F3
["\uE034"] = 0x3E, // F4
["\uE035"] = 0x3F, // F5
["\uE036"] = 0x40, // F6
["\uE037"] = 0x41, // F7
["\uE038"] = 0x42, // F8
["\uE039"] = 0x43, // F9
["\uE03A"] = 0x44, // F10
["\uE03B"] = 0x57, // F11
["\uE03C"] = 0x58, // F12
["\uE03D"] = 0x5B, // Meta / Command
["\uE040"] = 0x29 // ZenkakuHankaku
};

// A static dictionary mapping key names to their corresponding scan codes.
Expand Down
2 changes: 0 additions & 2 deletions src/Uia.DriverServer/Controllers/ActionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

using Swashbuckle.AspNetCore.Annotations;

using System.Text.Json;

using Uia.DriverServer.Domain;
using Uia.DriverServer.Models;

Expand Down

0 comments on commit 271246c

Please sign in to comment.