Skip to content

Commit

Permalink
fixed editor completion plugin that was resently broken
Browse files Browse the repository at this point in the history
  • Loading branch information
elfmz committed Apr 27, 2023
1 parent 30cdf82 commit 14e32e6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions editorcomp/src/editorcomp.cpp
Expand Up @@ -73,7 +73,6 @@ SHAREDSYMBOL int WINAPI ProcessEditorEventW(int Event, void *Param) {

SHAREDSYMBOL int WINAPI ProcessEditorInputW(const INPUT_RECORD *ir) {
if (ir->EventType == KEY_EVENT && (ir->Event.KeyEvent.dwControlKeyState & RELEVANT_MODIFIERS) == 0
&& ir->Event.KeyEvent.wVirtualScanCode == 0
&& !ir->Event.KeyEvent.bKeyDown
&& ir->Event.KeyEvent.wVirtualKeyCode == 0) {
return 0;
Expand All @@ -96,7 +95,7 @@ SHAREDSYMBOL int WINAPI ProcessEditorInputW(const INPUT_RECORD *ir) {
} else if (ir->EventType == KEY_EVENT) { // Is regular key event?
DWORD relevant_modifiers = (ir->Event.KeyEvent.dwControlKeyState & RELEVANT_MODIFIERS);

if (ir->Event.KeyEvent.bKeyDown && ir->Event.KeyEvent.wVirtualScanCode == 0) {
if (ir->Event.KeyEvent.bKeyDown) {
// Tab or Shift+Tab ?
if (ir->Event.KeyEvent.wVirtualKeyCode == VK_TAB && editor->getState() == DO_ACTION) {
switch (relevant_modifiers) {
Expand Down Expand Up @@ -129,7 +128,7 @@ SHAREDSYMBOL int WINAPI ProcessEditorInputW(const INPUT_RECORD *ir) {
}

// Is character-typing key event?
if (!ir->Event.KeyEvent.bKeyDown && ir->Event.KeyEvent.wVirtualScanCode == 0
if (!ir->Event.KeyEvent.bKeyDown
&& (relevant_modifiers == 0 || relevant_modifiers == SHIFT_PRESSED)
&& ir->Event.KeyEvent.wVirtualKeyCode != VK_TAB && ir->Event.KeyEvent.wVirtualKeyCode != VK_BACK
&& ir->Event.KeyEvent.wVirtualKeyCode != VK_ESCAPE && ir->Event.KeyEvent.wVirtualKeyCode != VK_DELETE
Expand Down
2 changes: 1 addition & 1 deletion far2l/src/console/keyboard.cpp
Expand Up @@ -608,7 +608,7 @@ DWORD GetInputRecord(INPUT_RECORD *rec, bool ExcludeMacro, bool ProcessMouse, bo
*/
if (Console.PeekInput(*rec)) {
// cheat for flock
if (rec->EventType == KEY_EVENT && !rec->Event.KeyEvent.wVirtualScanCode
if (rec->EventType == KEY_EVENT
&& (rec->Event.KeyEvent.wVirtualKeyCode == VK_NUMLOCK
|| rec->Event.KeyEvent.wVirtualKeyCode == VK_CAPITAL
|| rec->Event.KeyEvent.wVirtualKeyCode == VK_SCROLL)) {
Expand Down
1 change: 0 additions & 1 deletion far2l/src/ctrlobj.cpp
Expand Up @@ -189,7 +189,6 @@ void ControlObject::ShowStartupBanner(LPCWSTR EmergencyMsg)
{
std::vector<FARString> Lines;

char Xor = 17;
std::string tmp_mb;
for (const char *p = Copyright; *p; ++p) {
//const char c = (*p & 0x7f) ^ Xor;
Expand Down

0 comments on commit 14e32e6

Please sign in to comment.