Skip to content

Commit c6cf226

Browse files
committed
修改设备名称
1 parent c5ffdfc commit c6cf226

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
)
2525

2626
var go_build_version string = ""
27+
var uinput_keyboard_mouse_dev_name = ""
2728

2829
type event_pack struct {
2930
//表示一个动作 由一系列event组成
@@ -420,7 +421,7 @@ func auto_detect_and_read(event_chan chan *event_pack, patern string) {
420421
}
421422
for index, devType := range auto_detect_result {
422423
devName := get_dev_name_by_index(index)
423-
if devName == "go-touch-mapper-virtual-device" {
424+
if devName == uinput_keyboard_mouse_dev_name {
424425
continue //跳过生成的虚拟设备
425426
}
426427
re := regexp.MustCompile(patern)
@@ -599,8 +600,9 @@ func main() {
599600
}
600601

601602
if go_build_version == "" {
602-
go_build_version = "DEVELOPMENT BUILD"
603+
go_build_version = "DEV"
603604
}
605+
uinput_keyboard_mouse_dev_name = fmt.Sprintf("EVO80_Keyboard_%s", go_build_version)
604606
logger.Infof("当前构建版本: %v", go_build_version)
605607

606608
if *debug_mode {
@@ -808,6 +810,7 @@ func main() {
808810
logger.Info("触屏控制将使用uinput在本机处理")
809811
go handel_u_input_mouse_keyboard(fileted_u_input_control_ch)
810812
touch_control_func = handel_touch_using_uinput_touch()
813+
811814
}
812815

813816
map_switch_signal := make(chan bool) //通知虚拟鼠标当前为鼠标还是映射模式

u_input_interface.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func create_u_input_touch_screen(width int32, height int32) *os.File {
7575
absMax[absMtTrackingId] = 65535
7676

7777
uiDev := UinputUserDev{
78-
Name: toUInputName([]byte("v_touch_screen")),
78+
Name: toUInputName([]byte("fts")),
7979
ID: InputID{
8080
BusType: 0,
8181
Vendor: randUInt16Num(0x2000),
@@ -173,7 +173,7 @@ func create_u_input_mouse_keyboard() *os.File {
173173
}
174174

175175
uiDev := UinputUserDev{
176-
Name: toUInputName([]byte("go-touch-mapper-virtual-device")),
176+
Name: toUInputName([]byte(uinput_keyboard_mouse_dev_name)),
177177
ID: InputID{
178178
BusType: 0,
179179
Vendor: randUInt16Num(0x2000),

0 commit comments

Comments
 (0)