Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.Framework
Commits
85041636
Commit
85041636
authored
Feb 24, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
c47660e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
VIZ.Framework.Common/Widgets/HotkeyBox/HotkeyHelper.cs
+50
-0
No files found.
VIZ.Framework.Common/Widgets/HotkeyBox/HotkeyHelper.cs
View file @
85041636
...
...
@@ -67,5 +67,55 @@ namespace VIZ.Framework.Common
return
sb
.
ToString
();
}
/// <summary>
/// 获取热键值
/// </summary>
/// <param name="e">键盘事件</param>
/// <returns>热键值</returns>
public
static
string
GetHotkey
(
System
.
Windows
.
Forms
.
KeyEventArgs
e
)
{
StringBuilder
sb
=
new
StringBuilder
();
if
(
e
.
Control
)
{
sb
.
Append
(
"Ctrl + "
);
}
if
(
e
.
Alt
)
{
sb
.
Append
(
"Alt + "
);
}
if
(
e
.
Shift
)
{
sb
.
Append
(
"Shift + "
);
}
// D0 - D9
if
(
e
.
KeyCode
>=
System
.
Windows
.
Forms
.
Keys
.
D0
&&
e
.
KeyCode
<=
System
.
Windows
.
Forms
.
Keys
.
D9
)
{
sb
.
Append
(
$"
{
e
.
KeyCode
}
"
);
return
sb
.
ToString
();
}
// A - Z
if
(
e
.
KeyCode
>=
System
.
Windows
.
Forms
.
Keys
.
A
&&
e
.
KeyCode
<=
System
.
Windows
.
Forms
.
Keys
.
Z
)
{
sb
.
Append
(
$"
{
e
.
KeyCode
}
"
);
return
sb
.
ToString
();
}
// F1 - F12
if
(
e
.
KeyCode
>=
System
.
Windows
.
Forms
.
Keys
.
F1
&&
e
.
KeyCode
<=
System
.
Windows
.
Forms
.
Keys
.
F12
)
{
sb
.
Append
(
$"
{
e
.
KeyCode
}
"
);
return
sb
.
ToString
();
}
// Delete
if
(
e
.
KeyCode
==
System
.
Windows
.
Forms
.
Keys
.
Delete
)
{
sb
.
Append
(
$"
{
e
.
KeyCode
}
"
);
return
sb
.
ToString
();
}
return
sb
.
ToString
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment