Открыть боковую панель
МОС
Исходные коды
devel
smartcar
Коммиты
c3a59a40
Коммит
c3a59a40
создал
Июн 11, 2025
по автору
Коул Милена Ричардовна
Просмотр файлов
fix ru hot keys
владелец
6c4a5f15
Изменения
2
Скрыть пробелы
Построчно
Рядом
forms/bluetoothmode.cpp
Просмотр файла @
c3a59a40
...
...
@@ -6,6 +6,7 @@
#include
<QCoreApplication>
#include
<QUrl>
#include
<QKeyEvent>
#include
<QShortcut>
BluetoothMode
::
BluetoothMode
(
Vench
*
vench
,
QWidget
*
parent
)
:
QWidget
(
parent
),
...
...
@@ -20,6 +21,15 @@ BluetoothMode::BluetoothMode(Vench *vench, QWidget *parent) :
SetLStatus
();
// -------- Set Shortcuts (Hot keys) -------- //
(
new
QShortcut
(
QKeySequence
(
Qt
::
Key_B
),
this
,
[
this
](){
m_vench
->
on_BBip_B_clicked
();
}))
->
setAutoRepeat
(
false
);
(
new
QShortcut
(
QKeySequence
(
Qt
::
Key_L
),
this
,
[
this
](){
m_vench
->
on_BLight_B_clicked
();
}))
->
setAutoRepeat
(
false
);
(
new
QShortcut
(
QKeySequence
(
Qt
::
Key_Space
),
this
,
[
this
](){
m_vench
->
on_BStop_B_clicked
();
}))
->
setAutoRepeat
(
false
);
(
new
QShortcut
(
QKeySequence
(
Qt
::
Key_R
),
this
,
SLOT
(
RecClicked
())))
->
setAutoRepeat
(
false
);
(
new
QShortcut
(
QKeySequence
(
Qt
::
Key_P
),
this
,
SLOT
(
PlayClicked
())))
->
setAutoRepeat
(
false
);
(
new
QShortcut
(
QKeySequence
(
Qt
::
Key_H
),
this
,
SLOT
(
OpenGuidDoc
())))
->
setAutoRepeat
(
false
);
//--------------------------------------------//
connect
(
ui
->
BHelp
,
&
QPushButton
::
clicked
,
this
,
&
BluetoothMode
::
OpenGuidDoc
);
connect
(
ui
->
BBell
,
&
QPushButton
::
clicked
,
m_vench
,
&
Vench
::
on_BBip_B_clicked
);
...
...
@@ -50,48 +60,29 @@ void BluetoothMode::keyPressEvent(QKeyEvent *event)
{
if
(
event
->
isAutoRepeat
())
return
;
switch
(
event
->
key
())
{
case
Qt
::
Key_W
:
int
key
=
event
->
key
();
if
(
key
==
Qt
::
Key_W
||
key
==
1062
)
// Клавиша W (код "Ц" - 1062)
m_vench
->
on_BUp_B_pressed
();
break
;
case
Qt
::
Key_A
:
else
if
(
key
==
Qt
::
Key_A
||
key
==
1060
)
// Клавиша A (код "Ф" - 1060)
m_vench
->
on_BLeft_B_pressed
();
break
;
case
Qt
::
Key_S
:
else
if
(
key
==
Qt
::
Key_S
||
key
==
1067
)
// Клавиша S (код "Ы" - 1067)
m_vench
->
on_BDown_B_pressed
();
break
;
case
Qt
::
Key_D
:
else
if
(
key
==
Qt
::
Key_D
||
key
==
1042
)
// Клавиша D (код "В" - 1042)
m_vench
->
on_BRight_B_pressed
();
break
;
case
Qt
::
Key_B
:
m_vench
->
on_BBip_B_clicked
();
break
;
case
Qt
::
Key_L
:
m_vench
->
on_BLight_B_clicked
();
break
;
case
Qt
::
Key_Space
:
m_vench
->
on_BStop_B_clicked
();
break
;
case
Qt
::
Key_R
:
RecClicked
();
break
;
case
Qt
::
Key_P
:
PlayClicked
();
break
;
default:
else
QWidget
::
keyPressEvent
(
event
);
}
}
void
BluetoothMode
::
keyReleaseEvent
(
QKeyEvent
*
event
)
{
if
(
event
->
isAutoRepeat
())
return
;
int
key
=
event
->
key
();
if
(
key
==
Qt
::
Key_W
||
key
==
Qt
::
Key_A
||
key
==
Qt
::
Key_S
||
key
==
Qt
::
Key_D
)
if
(
key
==
Qt
::
Key_W
||
key
==
Qt
::
Key_A
||
key
==
Qt
::
Key_S
||
key
==
Qt
::
Key_D
||
key
==
1062
||
key
==
1060
||
key
==
1067
||
key
==
1042
)
// Код русской раскладки
m_vench
->
on_BStop_B_clicked
();
}
void
BluetoothMode
::
RuchnCommClicked
()
...
...
forms/bluetoothmode.ui
Просмотр файла @
c3a59a40
...
...
@@ -22,6 +22,22 @@
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label_logotip_b"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string/>
</property>
<property
name=
"pixmap"
>
<pixmap
resource=
"../res.qrc"
>
:/image/image/umki_logo_m.png
</pixmap>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
...
...
@@ -415,7 +431,7 @@
<string>
Запись
</string>
</property>
<property
name=
"checkable"
>
<bool>
tru
e
</bool>
<bool>
fals
e
</bool>
</property>
</widget>
</item>
...
...
@@ -425,7 +441,7 @@
<string>
Поехали
</string>
</property>
<property
name=
"checkable"
>
<bool>
tru
e
</bool>
<bool>
fals
e
</bool>
</property>
</widget>
</item>
...
...
@@ -446,38 +462,6 @@
</item>
</layout>
</item>
<item
row=
"0"
column=
"1"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label_20"
>
<property
name=
"text"
>
<string>
Не забудьте переключить раскладку клавиатуры в латинский алфавит (нижний регистр, CapsLock выключен)
</string>
</property>
<property
name=
"scaledContents"
>
<bool>
false
</bool>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
<property
name=
"wordWrap"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"0"
column=
"5"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label_logotip_b"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string/>
</property>
<property
name=
"pixmap"
>
<pixmap
resource=
"../res.qrc"
>
:/image/image/umki_logo_m.png
</pixmap>
</property>
</widget>
</item>
</layout>
</item>
<item>
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать