Skip to content

Commit

Permalink
Let Ctrl-2, Ctrl-Space, Ctrl-` generate 0x00
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximus5 committed Jul 23, 2017
1 parent e33effd commit 6effca8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
20 changes: 18 additions & 2 deletions ConEmuT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,24 @@ static DWORD WINAPI read_input_thread( void * )
}
break;
case KEY_EVENT:
if (r.Event.KeyEvent.uChar.UnicodeChar
&& r.Event.KeyEvent.bKeyDown)
if (!r.Event.KeyEvent.bKeyDown)
break;
// special for 'Ctrl+Space'
if (r.Event.KeyEvent.wVirtualKeyCode == VK_SPACE || r.Event.KeyEvent.wVirtualKeyCode == '2' || r.Event.KeyEvent.wVirtualKeyCode == '`')
{
if (r.Event.KeyEvent.dwControlKeyState & (RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED))
{
char s[5] = {0};
int len = 1; // 'Ctrl+Space' --> '\x00'
// TODO: Alt/Shift combo
ssize_t written = write(pty_fd, s, len);
#if defined(_USE_DEBUG_LOG_INPUT)
debug_log_format("read_input_thread: `\x%02u` written %i of %i bytes\n", (unsigned)s[0], written, len);
#endif
break;
}
}
if (r.Event.KeyEvent.uChar.UnicodeChar)
{
char s[5];
int len = WideCharToMultiByte(CP_UTF8, 0, &r.Event.KeyEvent.uChar.UnicodeChar, 1, s, sizeof(s)-1, 0, 0);
Expand Down
4 changes: 2 additions & 2 deletions version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#define VERSION_N 1,0,0,0
#define VERSION_S "1.0"
#define VERSION_N 1,1,0,0
#define VERSION_S "1.1"

#if defined(_USE_DEBUG_LOG)
#define VER_NAME " [debug]"
Expand Down

0 comments on commit 6effca8

Please sign in to comment.