!448 fix: Ctrl-C move out of LOS_MAGIC_KEY_ENABLE

Merge pull request !448 from MGY917/Ctrl-C_support
This commit is contained in:
openharmony_ci 2021-07-22 02:51:05 +00:00 committed by Gitee
commit 9e9c7b28d4
9 changed files with 6 additions and 20 deletions

View File

@ -66,12 +66,6 @@ STATIC MagicKeyOp g_magicHelpOp = {
.magicKey = 0x1a /* ctrl + z */
};
STATIC MagicKeyOp g_magicKillPgrp = {
.opHandler = KillPgrp,
.helpMsg = "Show all magic op key(ctrl+c) ",
.magicKey = 0x03 /* ctrl + c */
};
/*
* NOTICE:Suggest don't use
* ctrl+h/backspace=0x8,
@ -87,7 +81,7 @@ STATIC MagicKeyOp *g_magicOpTable[MAGIC_KEY_NUM] = {
&g_magicPanicOp, /* ctrl + p */
&g_magicTaskShowOp, /* ctrl + t */
&g_magicHelpOp, /* ctrl + z */
&g_magicKillPgrp /* ctrl + c */
NULL
};
STATIC VOID OsMagicHelp(VOID)
@ -129,7 +123,11 @@ INT32 CheckMagicKey(CHAR key)
#ifdef LOSCFG_ENABLE_MAGICKEY
INT32 i;
STATIC UINT32 magicKeySwitch = 0;
if (key == 0x12) { /* ctrl + r */
if (key == 0x03) { /* ctrl + c */
KillPgrp();
return 0;
} else if (key == 0x12) { /* ctrl + r */
magicKeySwitch = ~magicKeySwitch;
if (magicKeySwitch != 0) {
PRINTK("Magic key on\n");
@ -137,11 +135,7 @@ INT32 CheckMagicKey(CHAR key)
PRINTK("Magic key off\n");
}
return 1;
} else if (key == 0x03) { /* ctrl + c */
KillPgrp();
return 0;
}
if (magicKeySwitch != 0) {
for (i = 0; i < MAGIC_KEY_NUM; i++) {
if (g_magicOpTable[i] != NULL && key == g_magicOpTable[i]->magicKey) {

View File

@ -10,6 +10,5 @@ LOSCFG_BOARD_CONFIG_PATH="device/qemu/arm_virt/liteos_a/config/board"
# LOSCFG_FS_VFS is not set
# LOSCFG_NET_LWIP_SACK is not set
# LOSCFG_PLATFORM_ADAPT is not set
# LOSCFG_ENABLE_MAGICKEY is not set
# LOSCFG_DRIVERS is not set
# LOSCFG_SECURITY is not set

View File

@ -8,7 +8,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_CACHE_SYNC_THREAD=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y

View File

@ -9,7 +9,6 @@ LOSCFG_KERNEL_VDSO=y
LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y

View File

@ -10,7 +10,6 @@ LOSCFG_KERNEL_VDSO=y
LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y

View File

@ -9,7 +9,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_NET_LWIP_SACK_2_0=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y

View File

@ -9,7 +9,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_NET_LWIP_SACK_2_0=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y

View File

@ -8,7 +8,6 @@ LOSCFG_FS_FAT_CACHE_SYNC_THREAD=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_NET_LWIP_SACK_2_0=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y

View File

@ -6,7 +6,6 @@ LOSCFG_FS_FAT=y
LOSCFG_FS_FAT_DISK=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_ENABLE_MAGICKEY=y
LOSCFG_DEBUG_VERSION=y
# LOSCFG_SHELL_LK is not set
LOSCFG_USER_INIT_DEBUG=y