Fix the shortcut bug (a regression) in commit e9c50ed

Ref: e9c50ed967 (commitcomment-131870570)
pull/14339/head
Don Ho 2023-11-07 03:17:01 +01:00
parent e9c50ed967
commit 2fb8d7fc77
1 changed files with 6 additions and 2 deletions

View File

@ -539,8 +539,10 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
{
case VK_DELETE:
{
SHORT ctrl = GetKeyState(VK_CONTROL);
SHORT alt = GetKeyState(VK_MENU);
SHORT shift = GetKeyState(VK_SHIFT);
if (shift & 0x8000)
if ((shift & 0x8000) && !(ctrl & 0x8000) && !(alt & 0x8000))
{
bool hasSelection = (execute(SCI_GETSELECTIONSTART) != execute(SCI_GETSELECTIONEND));
if (!hasSelection)
@ -556,7 +558,9 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
case 'X':
{
SHORT ctrl = GetKeyState(VK_CONTROL);
if (ctrl & 0x8000)
SHORT alt = GetKeyState(VK_MENU);
SHORT shift = GetKeyState(VK_SHIFT);
if ((ctrl & 0x8000) && !(alt & 0x8000) && !(shift & 0x8000))
{
bool hasSelection = (execute(SCI_GETSELECTIONSTART) != execute(SCI_GETSELECTIONEND));
if (!hasSelection)