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
c47660e9
Commit
c47660e9
authored
Feb 23, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
快捷键控件bug修复
parent
a8013904
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
59 deletions
+24
-59
VIZ.Framework.Common/Widgets/HotkeyBox/HotkeyHelper.cs
+18
-53
VIZ.Framework.WpfTest/MainWindow.xaml
+1
-1
VIZ.Framework.WpfTest/VideoRender/OpenCVVideoTest.xaml.cs
+5
-5
No files found.
VIZ.Framework.Common/Widgets/HotkeyBox/HotkeyHelper.cs
View file @
c47660e9
...
@@ -22,82 +22,47 @@ namespace VIZ.Framework.Common
...
@@ -22,82 +22,47 @@ namespace VIZ.Framework.Common
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
// Ctl Alt Shift
// Ctl Alt Shift
if
(
e
.
KeyboardDevice
.
IsKeyDown
(
Key
.
LeftCtrl
)
||
e
.
KeyboardDevice
.
IsKeyDown
(
Key
.
RightCtr
l
))
if
(
e
.
KeyboardDevice
.
Modifiers
.
HasFlag
(
ModifierKeys
.
Contro
l
))
{
{
sb
.
Append
(
"Ctrl + "
);
sb
.
Append
(
"Ctrl + "
);
}
}
if
(
e
.
KeyboardDevice
.
IsKeyDown
(
Key
.
LeftAlt
)
||
e
.
KeyboardDevice
.
IsKeyDown
(
Key
.
Right
Alt
))
if
(
e
.
KeyboardDevice
.
Modifiers
.
HasFlag
(
ModifierKeys
.
Alt
))
{
{
sb
.
Append
(
"Alt + "
);
sb
.
Append
(
"Alt + "
);
}
}
if
(
e
.
KeyboardDevice
.
IsKeyDown
(
Key
.
LeftShift
)
||
e
.
KeyboardDevice
.
IsKeyDown
(
Key
.
Right
Shift
))
if
(
e
.
KeyboardDevice
.
Modifiers
.
HasFlag
(
ModifierKeys
.
Shift
))
{
{
sb
.
Append
(
"Shift + "
);
sb
.
Append
(
"Shift + "
);
}
}
// D0 - D9 A - Z
// D0 - D9 A - Z
for
(
int
i
=
(
int
)
Key
.
D0
;
i
<=
(
int
)
Key
.
Z
;
i
++
)
if
(
e
.
SystemKey
>=
Key
.
D0
&&
e
.
SystemKey
<=
Key
.
Z
)
{
{
Key
key
=
(
Key
)
i
;
sb
.
Append
(
$"
{
e
.
SystemKey
}
"
);
if
(
e
.
KeyboardDevice
.
IsKeyDown
(
key
))
{
sb
.
Append
(
$"
{
key
}
"
);
break
;
}
}
}
if
(
e
.
Key
>=
Key
.
D0
&&
e
.
Key
<=
Key
.
Z
)
// F1 - F12
for
(
int
i
=
(
int
)
Key
.
F1
;
i
<=
(
int
)
Key
.
F12
;
i
++)
{
{
Key
key
=
(
Key
)
i
;
sb
.
Append
(
$"
{
e
.
Key
}
"
);
if
(
e
.
KeyboardDevice
.
IsKeyDown
(
key
))
{
sb
.
Append
(
$"
{
key
}
"
);
break
;
}
}
}
return
sb
.
ToString
();
// F1 - F12
}
if
(
e
.
SystemKey
>=
Key
.
F1
&&
e
.
SystemKey
<=
Key
.
F12
)
/// <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 +
"
);
sb
.
Append
(
$"
{
e
.
SystemKey
}
"
);
}
}
// D0 - D9
if
(
e
.
Key
>=
Key
.
F1
&&
e
.
Key
<=
Key
.
F12
)
if
(
e
.
KeyCode
>=
System
.
Windows
.
Forms
.
Keys
.
D0
&&
e
.
KeyCode
<=
System
.
Windows
.
Forms
.
Keys
.
D9
)
{
{
sb
.
Append
(
$"
{
e
.
KeyCode
}
"
);
sb
.
Append
(
$"
{
e
.
Key
}
"
);
return
sb
.
ToString
();
}
}
// A - Z
if
(
e
.
KeyCode
>=
System
.
Windows
.
Forms
.
Keys
.
A
&&
e
.
KeyCode
<=
System
.
Windows
.
Forms
.
Keys
.
Z
)
// Delete
if
(
e
.
SystemKey
==
Key
.
Delete
)
{
{
sb
.
Append
(
$"
{
e
.
KeyCode
}
"
);
sb
.
Append
(
$"
{
e
.
SystemKey
}
"
);
return
sb
.
ToString
();
}
}
// F1 - F12
if
(
e
.
Key
==
Key
.
Delete
)
if
(
e
.
KeyCode
>=
System
.
Windows
.
Forms
.
Keys
.
F1
&&
e
.
KeyCode
<=
System
.
Windows
.
Forms
.
Keys
.
F12
)
{
{
sb
.
Append
(
$"
{
e
.
KeyCode
}
"
);
sb
.
Append
(
$"
{
e
.
Key
}
"
);
return
sb
.
ToString
();
}
}
return
sb
.
ToString
();
return
sb
.
ToString
();
...
...
VIZ.Framework.WpfTest/MainWindow.xaml
View file @
c47660e9
...
@@ -8,6 +8,6 @@
...
@@ -8,6 +8,6 @@
mc:Ignorable="d" WindowStartupLocation="CenterScreen" WindowState="Maximized"
mc:Ignorable="d" WindowStartupLocation="CenterScreen" WindowState="Maximized"
Title="MainWindow" Height="800" Width="1200">
Title="MainWindow" Height="800" Width="1200">
<Grid>
<Grid>
<local:
TallyTest></local:Tally
Test>
<local:
HotkeyBoxTest></local:HotkeyBox
Test>
</Grid>
</Grid>
</Window>
</Window>
VIZ.Framework.WpfTest/VideoRender/OpenCVVideoTest.xaml.cs
View file @
c47660e9
...
@@ -55,11 +55,11 @@ namespace VIZ.Framework.WpfTest
...
@@ -55,11 +55,11 @@ namespace VIZ.Framework.WpfTest
this
.
video
.
AttachPlugin
(
centerAxisPlugin
);
this
.
video
.
AttachPlugin
(
centerAxisPlugin
);
// 接入OpenCV插件
// 接入OpenCV插件
OpenCVStreamOption
option
=
new
OpenCVStreamOption
();
//
OpenCVStreamOption option = new OpenCVStreamOption();
OpenCVStream
stream
=
new
OpenCVStream
(
option
);
//
OpenCVStream stream = new OpenCVStream(option);
stream
.
ExecuteVideoFrame
+=
Stream_ExecuteVideoFrame
;
//
stream.ExecuteVideoFrame += Stream_ExecuteVideoFrame;
stream
.
ChangeUri
(
@"E:\视频\1.mp4"
);
//
stream.ChangeUri(@"E:\视频\1.mp4");
stream
.
Play
();
//
stream.Play();
// 更新矩形框信息
// 更新矩形框信息
//List<TrackingBoxInfo> list = new List<TrackingBoxInfo>();
//List<TrackingBoxInfo> list = new List<TrackingBoxInfo>();
...
...
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