mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-06 14:02:47 -05:00
Three new configurable options:
- Robert de Bath's Compose key is now off by default and configurable on - The ages-old controversy over whether ALT by itself should bring the System menu up is now controllable by a config option - You can now independently configure whether scrollback resets on a keypress _and_ whether it resets on screen activity. [originally from svn r741]
This commit is contained in:
45
window.c
45
window.c
@ -1870,25 +1870,28 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
|
||||
#endif
|
||||
|
||||
/* Note if AltGr was pressed and if it was used as a compose key */
|
||||
if (wParam == VK_MENU && (HIWORD(lParam)&KF_EXTENDED))
|
||||
{
|
||||
keystate[VK_RMENU] = keystate[VK_MENU];
|
||||
if (!compose_state) compose_key = wParam;
|
||||
}
|
||||
if (wParam == VK_APPS && !compose_state)
|
||||
compose_key = wParam;
|
||||
if (cfg.compose_key) {
|
||||
if (wParam == VK_MENU && (HIWORD(lParam)&KF_EXTENDED))
|
||||
{
|
||||
keystate[VK_RMENU] = keystate[VK_MENU];
|
||||
if (!compose_state) compose_key = wParam;
|
||||
}
|
||||
if (wParam == VK_APPS && !compose_state)
|
||||
compose_key = wParam;
|
||||
|
||||
if (wParam == compose_key)
|
||||
{
|
||||
if (compose_state == 0 && (HIWORD(lParam)&(KF_UP|KF_REPEAT))==0)
|
||||
compose_state = 1;
|
||||
else if (compose_state == 1 && (HIWORD(lParam)&KF_UP))
|
||||
compose_state = 2;
|
||||
else
|
||||
compose_state = 0;
|
||||
}
|
||||
else if (compose_state==1 && wParam != VK_CONTROL)
|
||||
compose_state = 0;
|
||||
if (wParam == compose_key)
|
||||
{
|
||||
if (compose_state == 0 && (HIWORD(lParam)&(KF_UP|KF_REPEAT))==0)
|
||||
compose_state = 1;
|
||||
else if (compose_state == 1 && (HIWORD(lParam)&KF_UP))
|
||||
compose_state = 2;
|
||||
else
|
||||
compose_state = 0;
|
||||
}
|
||||
else if (compose_state==1 && wParam != VK_CONTROL)
|
||||
compose_state = 0;
|
||||
} else
|
||||
compose_state = 0;
|
||||
|
||||
/* Nastyness with NUMLock - Shift-NUMLock is left alone though */
|
||||
if ( (cfg.funky_type == 3 || (cfg.funky_type <= 1 && app_keypad_keys))
|
||||
@ -2261,8 +2264,10 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
|
||||
}
|
||||
|
||||
/* This stops ALT press-release doing a 'COMMAND MENU' function */
|
||||
if (message == WM_SYSKEYUP && wParam == VK_MENU)
|
||||
return 0;
|
||||
if (!cfg.alt_only) {
|
||||
if (message == WM_SYSKEYUP && wParam == VK_MENU)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user