Compare commits
63
Commits
33ed574cbc
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18f3e36226 | ||
|
|
545be22235 | ||
|
|
1dff436028 | ||
|
|
edcf1722f9 | ||
|
|
fc8d0fbcd3 | ||
|
|
7afd676b43 | ||
|
|
87c95ceebe | ||
|
|
9d0d53a01f | ||
|
|
4e7a3517fd | ||
|
|
efa521dc9a | ||
|
|
37bb747250 | ||
|
|
03fad683e8 | ||
|
|
dfc4b3a0b8 | ||
|
|
7dd3fcc389 | ||
|
|
390e69f84d | ||
|
|
83d25f64d8 | ||
|
|
9b369d5b5a | ||
|
|
01bb16d592 | ||
|
|
418a100ea7 | ||
|
|
724396416e | ||
|
|
cdf8d0cf86 | ||
|
|
1302191806 | ||
|
|
cecf30c100 | ||
|
|
c492b73c1d | ||
|
|
a5414e941a | ||
|
|
81bab49a98 | ||
|
|
556de3d8fb | ||
|
|
ee6a4f5627 | ||
|
|
9624c90fcf | ||
|
|
de3496366c | ||
|
|
ece6708959 | ||
|
|
6afe61bcb9 | ||
|
|
5ef643617c | ||
|
|
f98f6fa65c | ||
|
|
a212bf59bc | ||
|
|
62dfde069f | ||
|
|
30212df73a | ||
|
|
1a36993911 | ||
|
|
2789f0efad | ||
|
|
a40772242d | ||
|
|
e7ad037590 | ||
|
|
afbf42e8fc | ||
|
|
174c4df540 | ||
|
|
8190d9a2e6 | ||
|
|
5788823aa2 | ||
|
|
366c555c71 | ||
|
|
0d51a3fb4f | ||
|
|
f5559a8842 | ||
|
|
51b71fc6a1 | ||
|
|
30fa449dc9 | ||
|
|
e81242c2fa | ||
|
|
53f0724d1e | ||
|
|
139d17d0b9 | ||
|
|
8bd5d36026 | ||
|
|
01de756d7f | ||
|
|
85b3ce8e09 | ||
|
|
7c6b7193df | ||
|
|
b6d4f06195 | ||
|
|
aaeb90a4a9 | ||
|
|
755716e5e1 | ||
|
|
720fd826a3 | ||
|
|
5eaff4fee4 | ||
|
|
427110aa3d |
+60
-20
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
@@ -103,6 +103,10 @@ namespace Hi.WinForm.Disp
|
||||
#endregion
|
||||
|
||||
#region Win32_Message_Handling
|
||||
/// <summary>
|
||||
/// Processes Windows messages, handling touch input and forwarding other messages to the base class.
|
||||
/// </summary>
|
||||
/// <param name="m">The Windows message to process.</param>
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
if (m.Msg == WM_TOUCH)
|
||||
@@ -251,36 +255,72 @@ namespace Hi.WinForm.Disp
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert WinForms Keys to W3C KeyboardEvent.key string.
|
||||
/// </summary>
|
||||
static string WinFormsKeyToW3C(Keys key) => (key & Keys.KeyCode) switch
|
||||
{
|
||||
Keys.Home => "Home",
|
||||
Keys.End => "End",
|
||||
Keys.PageUp => "PageUp",
|
||||
Keys.PageDown => "PageDown",
|
||||
Keys.Left => "ArrowLeft",
|
||||
Keys.Right => "ArrowRight",
|
||||
Keys.Up => "ArrowUp",
|
||||
Keys.Down => "ArrowDown",
|
||||
Keys.LShiftKey or Keys.RShiftKey or Keys.ShiftKey => "Shift",
|
||||
Keys.LControlKey or Keys.RControlKey or Keys.ControlKey => "Control",
|
||||
Keys.LMenu or Keys.RMenu or Keys.Menu => "Alt",
|
||||
Keys.Return => "Enter",
|
||||
Keys.Escape => "Escape",
|
||||
Keys.Back => "Backspace",
|
||||
Keys.Tab => "Tab",
|
||||
Keys.Delete => "Delete",
|
||||
Keys.Insert => "Insert",
|
||||
Keys.Space => " ",
|
||||
Keys.F1 => "F1",
|
||||
Keys.F2 => "F2",
|
||||
Keys.F3 => "F3",
|
||||
Keys.F4 => "F4",
|
||||
Keys.F5 => "F5",
|
||||
Keys.F6 => "F6",
|
||||
Keys.F7 => "F7",
|
||||
Keys.F8 => "F8",
|
||||
Keys.F9 => "F9",
|
||||
Keys.F10 => "F10",
|
||||
Keys.F11 => "F11",
|
||||
Keys.F12 => "F12",
|
||||
>= Keys.A and <= Keys.Z => ((char)('a' + ((key & Keys.KeyCode) - Keys.A))).ToString(),
|
||||
>= Keys.D0 and <= Keys.D9 => ((char)('0' + ((key & Keys.KeyCode) - Keys.D0))).ToString(),
|
||||
_ => "Unidentified"
|
||||
};
|
||||
|
||||
private void RenderingCanvas_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
Focus();
|
||||
DispEngine.KeyDown((long)e.KeyData);
|
||||
|
||||
// Map specific keys for view transformation
|
||||
long key = (long)e.KeyData;
|
||||
if (key == (long)Keys.LShiftKey || key == (long)Keys.RShiftKey || key == (long)Keys.ShiftKey)
|
||||
key = (long)Keys.Shift;
|
||||
string key = WinFormsKeyToW3C(e.KeyData);
|
||||
DispEngine.KeyDown(key);
|
||||
|
||||
DispEngine.KeyDownTransform(key, new key_table__transform_view_by_key_pressing_t()
|
||||
{
|
||||
HOME = (long)Keys.Home,
|
||||
PAGE_UP = (long)Keys.PageUp,
|
||||
PAGE_DOWN = (long)Keys.PageDown,
|
||||
F1 = (long)Keys.F1,
|
||||
F2 = (long)Keys.F2,
|
||||
F3 = (long)Keys.F3,
|
||||
F4 = (long)Keys.F4,
|
||||
SHIFT = (long)Keys.Shift,
|
||||
ARROW_LEFT = (long)Keys.Left,
|
||||
ARROW_RIGHT = (long)Keys.Right,
|
||||
ARROW_DOWN = (long)Keys.Down,
|
||||
ARROW_UP = (long)Keys.Up
|
||||
HOME = "Home",
|
||||
PAGE_UP = "PageUp",
|
||||
PAGE_DOWN = "PageDown",
|
||||
F1 = "F1",
|
||||
F2 = "F2",
|
||||
F3 = "F3",
|
||||
F4 = "F4",
|
||||
SHIFT = "Shift",
|
||||
ARROW_LEFT = "ArrowLeft",
|
||||
ARROW_RIGHT = "ArrowRight",
|
||||
ARROW_DOWN = "ArrowDown",
|
||||
ARROW_UP = "ArrowUp"
|
||||
});
|
||||
}
|
||||
|
||||
private void RenderingCanvas_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
DispEngine.KeyUp((long)e.KeyData);
|
||||
DispEngine.KeyUp(WinFormsKeyToW3C(e.KeyData));
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@ namespace Hi.WinForm.Disp
|
||||
/// The contained <see cref="Disp.RenderingCanvas"/>.
|
||||
/// </summary>
|
||||
public RenderingCanvas RenderingCanvas { get; }
|
||||
/// <summary>
|
||||
/// Gets or sets the displayee object for rendering.
|
||||
/// </summary>
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public IDisplayee Displayee
|
||||
{
|
||||
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net9.0-windows</TargetFramework>
|
||||
<TargetFramework>net10.0-windows</TargetFramework>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<AssemblyName>Hi.WinForm</AssemblyName>
|
||||
<RootNamespace>$(AssemblyName)</RootNamespace>
|
||||
<Platforms>x64</Platforms>
|
||||
<Description>WinForm Display module of HiAPI</Description>
|
||||
<VersionBuild>72</VersionBuild>
|
||||
<VersionBuild>156</VersionBuild>
|
||||
<VersionPrefix>3.1.$(VersionBuild)</VersionPrefix>
|
||||
<PackageTags>HiAPI</PackageTags>
|
||||
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
|
||||
|
||||
+2
-1
@@ -16,7 +16,8 @@ namespace Hi.WinForm
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
License.LogInAll();
|
||||
License.AbortMessageAction += Console.WriteLine;
|
||||
License.LogInAll();
|
||||
DispEngine.Init();
|
||||
Application.ApplicationExit += (object sender, EventArgs e) =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user