Change shortcuts toggle: from shortcut to menu item

This commit is contained in:
cyd01
2020-04-09 19:57:58 +02:00
parent 9284b8896c
commit b2cffb36da
5 changed files with 36 additions and 11 deletions
+11 -3
View File
@@ -1500,6 +1500,12 @@ TrayIcone.hWnd = hwnd ;
AppendMenu(FontMenu, MF_ENABLED, IDM_FONTNEGATIVE, "Negative");
AppendMenu(FontMenu, MF_ENABLED, IDM_FONTBLACKANDWHITE, "Black and White");
AppendMenu(m, MF_POPUP | MF_ENABLED, (UINT) FontMenu, "Font settings");
if( GetShortcutsFlag() )
AppendMenu(m, MF_ENABLED|MF_CHECKED, IDM_SHORTCUTSTOGGLE, "Shortcuts toggle");
else
AppendMenu(m, MF_ENABLED, IDM_SHORTCUTSTOGGLE, "Shortcuts toggle");
AppendMenu(m, MF_SEPARATOR, 0, 0);
AppendMenu(m, MF_ENABLED, IDM_SCRIPTFILE, "Send scr&ipt file" ) ;
@@ -4023,6 +4029,9 @@ else if((UINT_PTR)wParam == TIMER_LOGROTATION) { // log rotation
case IDM_VISIBLE:
ManageVisible( hwnd, wintw, conf_get_str(conf, CONF_wintitle) ) ;
break ;
case IDM_SHORTCUTSTOGGLE:
ManageShortcutsFlag( hwnd ) ;
break ;
case IDM_TOTRAY:
if( GetVisibleFlag()==VISIBLE_YES ) {
SetVisibleFlag( VISIBLE_TRAY ) ;
@@ -5209,7 +5218,6 @@ else if((UINT_PTR)wParam == TIMER_LOGROTATION) { // log rotation
}
#endif
#ifdef MOD_PERSO
if( (wParam == VK_TAB) && (GetKeyState(VK_CONTROL) & 0x8000) ) { // CTRL + TAB to switch between windows
if (conf_get_int(conf, CONF_ctrl_tab_switch) && GetCtrlTabFlag()) {
if( message==WM_KEYUP ) {
@@ -5242,10 +5250,10 @@ else if((UINT_PTR)wParam == TIMER_LOGROTATION) { // log rotation
}
#endif
/*
if((wParam==VK_F1)&&(message==WM_KEYDOWN)&&(GetKeyState(VK_CONTROL)&0x8000)&&(GetKeyState(VK_SHIFT)&0x8000)) // CTRL+SHIFT+F1 => Manage shortcut flag
{ SetShortcutsFlag( abs(GetShortcutsFlag()-1) ) ; return 0 ; }
*/
if( GetShortcutsFlag() ) {
if ( (message==WM_KEYDOWN)||(message==WM_SYSKEYDOWN) ) {
+5 -3
View File
@@ -1,3 +1,5 @@
[//]: # (title:KiTTY, a free telnet/ssh client for Windows)
# Welcome to the KiTTY introduction web site
## What is KiTTY ?
@@ -19,7 +21,7 @@ KiTTY has all the features from the original software, and adds many others as d
* Automatic password
* Automatic command
* Running a locally saved script on a remote session
* ~~ZModem integration~~
* ZModem integration
### Graphical features
* An icon for each session
@@ -37,8 +39,8 @@ KiTTY has all the features from the original software, and adds many others as d
* pscp.exe and WinSCP integration
* Binary compression
* Clipboard printing
* Cygwin and cmd.exe intégration
* ~~Background image~~
* The PuTTYCyg patch
* Background image
* File association
* Other settings
* New command-line options
+14 -3
View File
@@ -1868,16 +1868,27 @@ void ManageVisible( HWND hwnd, TermWin *tw, char * title ) {
SetWindowPos(hwnd,(HWND)-1,0,0,0,0, SWP_NOMOVE |SWP_NOSIZE ) ;
conf_set_bool( conf, CONF_alwaysontop, true ) ;
set_title(tw, title) ;
}
else {
} else {
CheckMenuItem( m, (UINT)IDM_VISIBLE, MF_BYCOMMAND|MF_UNCHECKED ) ;
SetWindowPos(hwnd,(HWND)-2,0,0,0,0, SWP_NOMOVE |SWP_NOSIZE ) ;
conf_set_bool( conf, CONF_alwaysontop, false ) ;
set_title(tw, title) ;
}
}
}
}
void ManageShortcutsFlag( HWND hwnd ) {
HMENU m ;
SetShortcutsFlag( abs(GetShortcutsFlag()-1) ) ;
if( ( m = GetSystemMenu (hwnd, FALSE) ) != NULL ) {
if( GetShortcutsFlag() ) {
CheckMenuItem( m, (UINT)IDM_SHORTCUTSTOGGLE, MF_BYCOMMAND|MF_CHECKED ) ;
} else {
CheckMenuItem( m, (UINT)IDM_SHORTCUTSTOGGLE, MF_BYCOMMAND|MF_UNCHECKED ) ;
}
}
}
// Gere la demande de relance de l'application
void ManageRestart( HWND hwnd ) {
SendMessage( hwnd, WM_COMMAND, IDM_RESTART, 0 ) ;
+5 -1
View File
@@ -589,9 +589,13 @@ void xyz_updateMenuItems(Terminal *term) ;
#endif
#endif
#ifndef IDM_SHORTCUTSTOGGLE
#define IDM_SHORTCUTSTOGGLE 0xB120
#endif
// Doit etre le dernier
#ifndef IDM_LAUNCHER
#define IDM_LAUNCHER 0xB120
#define IDM_LAUNCHER 0xB130
#endif
// USERCMD doit etre la plus grande valeur pour permettre d'avoir autant de raccourcis qu'on le souhaite
+1 -1
View File
@@ -87,7 +87,7 @@ cygterm=no
;downloaddir=
; fileextension: the extension for session settings files in portable mode
;fileextension=
;fileextension=.ktx
; hyperlink: enable/disable the hyperlink feature
hyperlink=yes