Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
1059-Consistently-use-for-key-combinations-in-s...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1059-Consistently-use-for-key-combinations-in-source-code.patch of Package erlang
From ea381d01429b08e4426ef10d168788112d9193d4 Mon Sep 17 00:00:00 2001 From: Richard Carlsson <carlsson.richard@gmail.com> Date: Thu, 13 Jun 2024 15:46:54 +0200 Subject: [PATCH 2/2] Consistently use `+` for key combinations in source code and UI Ensure that the UI is consistent (help messages, menus, etc.) and that it's easy to grep in the code. Note that the documentation has a different style and uses `-` to describe key combinations. --- erts/emulator/beam/break.c | 2 +- erts/emulator/beam/erl_init.c | 4 +- erts/emulator/sys/unix/erl_child_setup.c | 2 +- erts/emulator/sys/unix/sys.c | 12 +++--- erts/emulator/sys/win32/sys_interrupt.c | 2 +- lib/debugger/test/dbg_ui_SUITE.erl | 8 ++-- .../valid_keymap.config | 8 ++-- lib/observer/src/observer_port_wx.erl | 4 +- lib/observer/src/observer_pro_wx.erl | 2 +- lib/observer/src/observer_procinfo.erl | 2 +- lib/observer/src/observer_sock_wx.erl | 4 +- lib/observer/src/observer_sys_wx.erl | 2 +- lib/observer/src/observer_trace_wx.erl | 4 +- lib/observer/src/observer_tv_table.erl | 8 ++-- lib/observer/src/observer_tv_wx.erl | 4 +- lib/reltool/test/reltool_manual_gui_SUITE.erl | 2 +- lib/ssh/src/ssh_connect.hrl | 4 +- lib/ssl/test/dtls_api_SUITE.erl | 2 +- lib/stdlib/doc/stdlib_app.md | 2 +- lib/stdlib/src/edlin_key.erl | 8 ++-- lib/stdlib/src/erl_scan.erl | 2 +- lib/stdlib/src/shell.erl | 2 +- lib/wx/examples/simple/menu.erl | 42 +++++++++---------- lib/wx/src/gen/wxKeyEvent.erl | 8 ++-- lib/wx/src/gen/wxMenuBar.erl | 2 +- lib/wx/src/gen/wxNavigationKeyEvent.erl | 2 +- 26 files changed, 72 insertions(+), 72 deletions(-) diff --git a/erts/emulator/beam/break.c b/erts/emulator/beam/break.c index 3e72576bda..35f757b036 100644 --- a/erts/emulator/beam/break.c +++ b/erts/emulator/beam/break.c @@ -608,7 +608,7 @@ do_break(void) case '*': /* * The asterisk is an read error on windows, * where sys_get_key isn't that great in console mode. - * The usual reason for a read error is Ctrl-C. Treat this as + * The usual reason for a read error is Ctrl+C. Treat this as * 'a' to avoid infinite loop. */ erts_exit(0, ""); diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c index 45c10d1e23..90a2bd7c45 100644 --- a/erts/emulator/beam/erl_init.c +++ b/erts/emulator/beam/erl_init.c @@ -553,8 +553,8 @@ void erts_usage(void) ERTS_MAX_NO_OF_ASYNC_THREADS); erts_fprintf(stderr, "\n"); - erts_fprintf(stderr, "-B[c|d|i] set break (Ctrl-C) behavior; valid letters are:\n"); - erts_fprintf(stderr, " 'c' to have Ctrl-C interrupt the Erlang shell;\n"); + erts_fprintf(stderr, "-B[c|d|i] set break (Ctrl+C) behavior; valid letters are:\n"); + erts_fprintf(stderr, " 'c' to have Ctrl+C interrupt the Erlang shell;\n"); erts_fprintf(stderr, " 'd' (or no extra option) to disable the break handler;\n"); erts_fprintf(stderr, " 'i' to ignore break signals\n"); erts_fprintf(stderr, "\n"); diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c index 19608ef5c9..9f83357fad 100644 --- a/erts/emulator/sys/unix/sys.c +++ b/erts/emulator/sys/unix/sys.c @@ -759,12 +759,12 @@ void erts_set_ignore_break(void) { * typing certain key combinations at the * controlling terminal... */ - sys_signal(SIGINT, SIG_IGN); /* Ctrl-C */ - sys_signal(SIGQUIT, SIG_IGN); /* Ctrl-\ */ - sys_signal(SIGTSTP, SIG_IGN); /* Ctrl-Z */ + sys_signal(SIGINT, SIG_IGN); /* Ctrl+C */ + sys_signal(SIGQUIT, SIG_IGN); /* Ctrl+\ */ + sys_signal(SIGTSTP, SIG_IGN); /* Ctrl+Z */ } -/* Don't use Ctrl-C for break handler but let it be +/* Don't use Ctrl+C for break handler but let it be used by the shell instead (see user_drv.erl) */ void erts_replace_intr(void) { struct termios mode; @@ -772,11 +772,11 @@ void erts_replace_intr(void) { if (isatty(0)) { tcgetattr(0, &mode); - /* here's an example of how to replace Ctrl-C with Ctrl-U */ + /* here's an example of how to replace Ctrl+C with Ctrl+U */ /* mode.c_cc[VKILL] = 0; mode.c_cc[VINTR] = CKILL; */ - mode.c_cc[VINTR] = 0; /* disable Ctrl-C */ + mode.c_cc[VINTR] = 0; /* disable Ctrl+C */ tcsetattr(0, TCSANOW, &mode); replace_intr = 1; } diff --git a/erts/emulator/sys/win32/sys_interrupt.c b/erts/emulator/sys/win32/sys_interrupt.c index fbbd7a1b76..c039da63c5 100644 --- a/erts/emulator/sys/win32/sys_interrupt.c +++ b/erts/emulator/sys/win32/sys_interrupt.c @@ -111,7 +111,7 @@ BOOL WINAPI ctrl_handler_replace_intr(DWORD dwCtrlType) } -/* Don't use Ctrl-C for break handler but let it be +/* Don't use Ctrl+C for break handler but let it be used by the shell instead (see user_drv.erl) */ void erts_replace_intr(void) { ConSetCtrlHandler(ctrl_handler_replace_intr); diff --git a/lib/debugger/test/dbg_ui_SUITE.erl b/lib/debugger/test/dbg_ui_SUITE.erl index 0b519e6a32..b4bee285f2 100644 --- a/lib/debugger/test/dbg_ui_SUITE.erl +++ b/lib/debugger/test/dbg_ui_SUITE.erl @@ -192,10 +192,10 @@ Interpret one module"). "Start the debugger and interpret the modules [test, lists1, ordsets1]. Close the Interpret dialog. Set Attach on First Call and Attach on Break."). ?MAN_CASE(all_step3, "Click Step through all evaluation", - "In the shell, call test:test1(). Use the Step button, the Process->Step menu item and the Ctrl-S shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}"). + "In the shell, call test:test1(). Use the Step button, the Process->Step menu item and the Ctrl+S shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}"). ?MAN_CASE(all_next3,"Click Next through all evaluation", - "Again call test:test1() in the shell. This time Use the Next button, the Process->Next menu and the Ctrl-N shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}"). + "Again call test:test1() in the shell. This time Use the Next button, the Process->Next menu and the Ctrl+N shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}"). ?MAN_CASE(save3, "Save the debugger state", "Use File->Save Settings to save the debugger state with the name 'three.state'"). @@ -256,7 +256,7 @@ Interpret one module"). ?MAN_CASE(all_step6, "Click Step through all evaluation", - "In the bar shell, call test:test1().This should open an attach window. Use the Step button, the Process->Step menu item and the Ctrl-S shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the bar shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}"). + "In the bar shell, call test:test1().This should open an attach window. Use the Step button, the Process->Step menu item and the Ctrl+S shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the bar shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}"). ?MAN_CASE(all_next6,"Click Next through all evaluation", - "Again, in the bar shell, call test:test1(). This time Use the Next button, the Process->Next menu and the Ctrl-N shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}"). + "Again, in the bar shell, call test:test1(). This time Use the Next button, the Process->Next menu and the Ctrl+N shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}"). diff --git a/lib/observer/src/observer_port_wx.erl b/lib/observer/src/observer_port_wx.erl index d39687fbac..18028f1c92 100644 --- a/lib/observer/src/observer_port_wx.erl +++ b/lib/observer/src/observer_port_wx.erl @@ -374,9 +374,9 @@ create_menus(Parent) -> MenuEntries = [{"View", [#create_menu{id = ?ID_PORT_INFO_SELECTED, - text = "Port info for selected ports\tCtrl-I"}, + text = "Port info for selected ports\tCtrl+I"}, separator, - #create_menu{id = ?ID_REFRESH, text = "Refresh\tCtrl-R"}, + #create_menu{id = ?ID_REFRESH, text = "Refresh\tCtrl+R"}, #create_menu{id = ?ID_REFRESH_INTERVAL, text = "Refresh Interval..."} ]}, {"Trace", diff --git a/lib/observer/src/observer_pro_wx.erl b/lib/observer/src/observer_pro_wx.erl index 23c082e025..72ff278ba7 100644 --- a/lib/observer/src/observer_pro_wx.erl +++ b/lib/observer/src/observer_pro_wx.erl @@ -133,7 +133,7 @@ create_pro_menu(Parent, Holder) -> type=check, check=call(Holder, {get_accum, self()})}, separator, - #create_menu{id=?ID_REFRESH, text="Refresh\tCtrl-R"}, + #create_menu{id=?ID_REFRESH, text="Refresh\tCtrl+R"}, #create_menu{id=?ID_REFRESH_INTERVAL, text="Refresh Interval"}]}, {"Trace", [#create_menu{id=?ID_TRACE_PIDS, text="Trace processes"}, diff --git a/lib/observer/src/observer_procinfo.erl b/lib/observer/src/observer_procinfo.erl index a558546f52..89cd8b1b26 100644 --- a/lib/observer/src/observer_procinfo.erl +++ b/lib/observer/src/observer_procinfo.erl @@ -365,7 +365,7 @@ init_log_page(Parent, Pid, Table) -> create_menus(MenuBar) -> Menus = [{"File", [#create_menu{id=?wxID_CLOSE, text="Close"}]}, - {"View", [#create_menu{id=?REFRESH, text="Refresh\tCtrl-R"}]}], + {"View", [#create_menu{id=?REFRESH, text="Refresh\tCtrl+R"}]}], observer_lib:create_menus(Menus, MenuBar, new_window). process_info_fields(Pid, WSz) -> diff --git a/lib/observer/src/observer_sock_wx.erl b/lib/observer/src/observer_sock_wx.erl index 90591acac2..031c1dd9f2 100644 --- a/lib/observer/src/observer_sock_wx.erl +++ b/lib/observer/src/observer_sock_wx.erl @@ -418,9 +418,9 @@ create_menus(Parent) -> MenuEntries = [{"View", [#create_menu{id = ?ID_SOCKET_INFO_SELECTED, - text = "Socket info for selected sockets\tCtrl-I"}, + text = "Socket info for selected sockets\tCtrl+I"}, separator, - #create_menu{id = ?ID_REFRESH, text = "Refresh\tCtrl-R"}, + #create_menu{id = ?ID_REFRESH, text = "Refresh\tCtrl+R"}, #create_menu{id = ?ID_REFRESH_INTERVAL, text = "Refresh Interval..."} ]}%% , %% {"Debug", diff --git a/lib/observer/src/observer_sys_wx.erl b/lib/observer/src/observer_sys_wx.erl index e6ec02f606..25152178b8 100644 --- a/lib/observer/src/observer_sys_wx.erl +++ b/lib/observer/src/observer_sys_wx.erl @@ -86,7 +86,7 @@ init([Notebook, Parent, Config]) -> create_sys_menu(Parent) -> - View = {"View", [#create_menu{id = ?ID_REFRESH, text = "Refresh\tCtrl-R"}, + View = {"View", [#create_menu{id = ?ID_REFRESH, text = "Refresh\tCtrl+R"}, #create_menu{id = ?ID_REFRESH_INTERVAL, text = "Refresh interval"}]}, observer_wx:create_menus(Parent, [View]). diff --git a/lib/observer/src/observer_trace_wx.erl b/lib/observer/src/observer_trace_wx.erl index 2b727d0a26..376f170a89 100644 --- a/lib/observer/src/observer_trace_wx.erl +++ b/lib/observer/src/observer_trace_wx.erl @@ -992,8 +992,8 @@ create_logwindow(Parent, true) -> LogWin = wxFrame:new(Parent, ?LOG_WIN, "Trace Log", [{size, {750*Scale, 800*Scale}}]), MB = wxMenuBar:new(), File = wxMenu:new(), - wxMenu:append(File, ?LOG_CLEAR, "Clear Log\tCtrl-C"), - wxMenu:append(File, ?LOG_SAVE, "Save Log\tCtrl-S"), + wxMenu:append(File, ?LOG_CLEAR, "Clear Log\tCtrl+C"), + wxMenu:append(File, ?LOG_SAVE, "Save Log\tCtrl+S"), wxMenu:append(File, ?wxID_CLOSE, "Close"), wxMenuBar:append(MB, File, "File"), wxFrame:setMenuBar(LogWin, MB), diff --git a/lib/observer/src/observer_tv_table.erl b/lib/observer/src/observer_tv_table.erl index 669ee82e3f..1831e5c10f 100644 --- a/lib/observer/src/observer_tv_table.erl +++ b/lib/observer/src/observer_tv_table.erl @@ -177,16 +177,16 @@ add_columns(Grid, Start, ColumnNames) -> create_menus(MB) -> File = wxMenu:new(), - wxMenu:append(File, ?ID_TABLE_INFO, "Table Information\tCtrl-I"), + wxMenu:append(File, ?ID_TABLE_INFO, "Table Information\tCtrl+I"), wxMenu:append(File, ?wxID_CLOSE, "Close"), wxMenuBar:append(MB, File, "File"), Edit = wxMenu:new(), wxMenu:append(Edit, ?ID_EDIT, "Edit Object"), - wxMenu:append(Edit, ?ID_DELETE, "Delete Object\tCtrl-D"), + wxMenu:append(Edit, ?ID_DELETE, "Delete Object\tCtrl+D"), wxMenu:appendSeparator(Edit), - wxMenu:append(Edit, ?ID_SEARCH, "Search\tCtrl-S"), + wxMenu:append(Edit, ?ID_SEARCH, "Search\tCtrl+S"), wxMenu:appendSeparator(Edit), - wxMenu:append(Edit, ?ID_REFRESH, "Refresh\tCtrl-R"), + wxMenu:append(Edit, ?ID_REFRESH, "Refresh\tCtrl+R"), wxMenu:append(Edit, ?ID_REFRESH_INTERVAL, "Refresh interval..."), wxMenuBar:append(MB, Edit, "Edit"), Help = wxMenu:new(), diff --git a/lib/observer/src/observer_tv_wx.erl b/lib/observer/src/observer_tv_wx.erl index 9f9636797c..5649a8986d 100644 --- a/lib/observer/src/observer_tv_wx.erl +++ b/lib/observer/src/observer_tv_wx.erl @@ -291,7 +291,7 @@ code_change(_, _, State) -> create_menus(Parent, #opts{sys_hidden=Sys, unread_hidden=UnR, type=Type}) -> MenuEntries = [{"View", - [#create_menu{id = ?ID_TABLE_INFO, text = "Table information\tCtrl-I"}, + [#create_menu{id = ?ID_TABLE_INFO, text = "Table information\tCtrl+I"}, separator, #create_menu{id = ?ID_ETS, text = "&Ets Tables", type=radio, check=Type==ets}, @@ -303,7 +303,7 @@ create_menus(Parent, #opts{sys_hidden=Sys, unread_hidden=UnR, type=Type}) -> #create_menu{id = ?ID_SYSTEM_TABLES, text = "View &System Tables", type=check, check=not Sys}, separator, - #create_menu{id = ?ID_REFRESH, text = "Refresh\tCtrl-R"}, + #create_menu{id = ?ID_REFRESH, text = "Refresh\tCtrl+R"}, #create_menu{id = ?ID_REFRESH_INTERVAL, text = "Refresh Interval..."} ]}], observer_wx:create_menus(Parent, MenuEntries). diff --git a/lib/reltool/test/reltool_manual_gui_SUITE.erl b/lib/reltool/test/reltool_manual_gui_SUITE.erl index 659c51f23b..4e4fc742f5 100644 --- a/lib/reltool/test/reltool_manual_gui_SUITE.erl +++ b/lib/reltool/test/reltool_manual_gui_SUITE.erl @@ -172,7 +172,7 @@ config(Config) -> {ok,ServerPid} = reltool:get_server(SysPid), unlink(SysPid), break("the system window is still alive", - "terminate reltool by hitting 'Ctrl-Q' (linux) or clicking the " + "terminate reltool by hitting 'Ctrl+Q' (linux) or clicking the " "close box on the top fram when system window is active"), false = erlang:is_process_alive(SysPid), false = erlang:is_process_alive(ServerPid), diff --git a/lib/ssh/src/ssh_connect.hrl b/lib/ssh/src/ssh_connect.hrl index 7b985451f8..e9e924d128 100644 --- a/lib/ssh/src/ssh_connect.hrl +++ b/lib/ssh/src/ssh_connect.hrl @@ -180,8 +180,8 @@ -define(VEOL,6). %% End-of-line character in addition to carriage return %% or,and). linefeed. -define(VEOL2,7). %% Additional end-of-line character. --define(VSTART,8). %% Continues paused output (normally Ctrl-Q). --define(VSTOP,9). %% Pauses output (normally Ctrl-S). +-define(VSTART,8). %% Continues paused output (normally Ctrl+Q). +-define(VSTOP,9). %% Pauses output (normally Ctrl+S). -define(VSUSP,10). %% Suspends the current program. -define(VDSUSP,11). %% Another suspend character. -define(VREPRINT,12). %% Reprints the current input line. diff --git a/lib/stdlib/src/erl_scan.erl b/lib/stdlib/src/erl_scan.erl index 9215e2df01..313d89ee11 100644 --- a/lib/stdlib/src/erl_scan.erl +++ b/lib/stdlib/src/erl_scan.erl @@ -1718,7 +1718,7 @@ scan_escape([$x,H1], _Col) when ?HEX(H1) -> more; scan_escape([$x|Cs], Col) -> {error,Cs,{illegal,character},incr_column(Col, 1)}; -%% \^X -> Ctrl-X +%% \^X -> Ctrl+X scan_escape([$^=C0,C|Cs], Col) when ?CHAR(C) -> case caret_char_code(C) of error -> diff --git a/lib/wx/examples/simple/menu.erl b/lib/wx/examples/simple/menu.erl index 558810ae28..ee4b92a00a 100644 --- a/lib/wx/examples/simple/menu.erl +++ b/lib/wx/examples/simple/menu.erl @@ -161,14 +161,14 @@ create_file_menu() -> ])), ClearLogItem = wxMenuItem:new([ {id, ?menuID_FILE_CLEAR_LOG}, - {text, "Clear &log\tCtrl-L"} %% note mnemonic and accelerator + {text, "Clear &log\tCtrl+L"} %% note mnemonic and accelerator ]), wxMenu:append(FileMenu, ClearLogItem ), wxMenu:appendSeparator(FileMenu), wxMenu:append(FileMenu, wxMenuItem:new([ {id, ?menuID_FILE_QUIT} %, - %{text, "E&xit\tAlt-X"} + %{text, "E&xit\tAlt+X"} ])), FileMenu. @@ -179,47 +179,47 @@ create_menubar_menu() -> MenuBarMenu = wxMenu:new(), wxMenu:append(MenuBarMenu, wxMenuItem:new([ {id, ?menuID_MENUBAR_APPEND}, - {text, "&Append menu\tCtrl-A"}, + {text, "&Append menu\tCtrl+A"}, {help, "Append a menu to the menubar"} ])), wxMenu:append(MenuBarMenu, wxMenuItem:new([ {id, ?menuID_MENUBAR_INSERT}, - {text, "&Insert menu\tCtrl-I"}, + {text, "&Insert menu\tCtrl+I"}, {help, "Insert a menu into the menubar"} ])), wxMenu:append(MenuBarMenu, wxMenuItem:new([ {id, ?menuID_MENUBAR_DELETE}, - {text, "&Delete menu\tCtrl-D"}, + {text, "&Delete menu\tCtrl+D"}, {help, "Insert a menu into the menubar"} ])), wxMenu:append(MenuBarMenu, wxMenuItem:new([ {id, ?menuID_MENUBAR_TOGGLE}, - {text, "&Toggle menu\tCtrl-T"}, + {text, "&Toggle menu\tCtrl+T"}, {help, "Toggle the first menu in the menubar"}, {kind, ?wxITEM_CHECK} ])), wxMenu:appendSeparator(MenuBarMenu), %% -------------------------- wxMenu:append(MenuBarMenu, wxMenuItem:new([ {id, ?menuID_MENUBAR_ENABLE}, - {text, "&Enable menu\tCtrl-E"}, + {text, "&Enable menu\tCtrl+E"}, {help, "Enable or disable the last menu"}, {kind, ?wxITEM_CHECK} ])), wxMenu:appendSeparator(MenuBarMenu), %% -------------------------- wxMenu:append(MenuBarMenu, wxMenuItem:new([ {id, ?menuID_MENUBAR_GET_LABEL}, - {text, "&Get menu label\tCtrl-G"}, + {text, "&Get menu label\tCtrl+G"}, {help, "Get the label of the last menu"} ])), wxMenu:append(MenuBarMenu, wxMenuItem:new([ {id, ?menuID_MENUBAR_SET_LABEL}, - {text, "&Set menu label\tCtrl-S"}, + {text, "&Set menu label\tCtrl+S"}, {help, "Change the label of the last menu"} ])), wxMenu:appendSeparator(MenuBarMenu), %% -------------------------- wxMenu:append(MenuBarMenu, wxMenuItem:new([ {id, ?menuID_MENUBAR_FIND_MENU}, - {text, "&Find menu from label\tCtrl-F"}, + {text, "&Find menu from label\tCtrl+F"}, {help, "Find a menu by searching for its label"} ])), MenuBarMenu. @@ -232,46 +232,46 @@ create_menu_menu() -> MenuMenu = wxMenu:new(), wxMenu:append(MenuMenu, wxMenuItem:new([ {id, ?menuID_MENU_APPEND}, - {text, "&Append menu item\tAlt-A"}, + {text, "&Append menu item\tAlt+A"}, {help, "Append a menu item to the last menu"} ])), wxMenu:append(MenuMenu, wxMenuItem:new([ {id, ?menuID_MENU_APPEND_SUB}, - {text, "&Append sub menu\tAlt-S"}, + {text, "&Append sub menu\tAlt+S"}, {help, "Append a sub menu to the last menu"} ])), wxMenu:append(MenuMenu, wxMenuItem:new([ {id, ?menuID_MENU_INSERT}, - {text, "&Insert menu item\tAlt-I"}, + {text, "&Insert menu item\tAlt+I"}, {help, "Insert a menu item in head of the last menu"} ])), wxMenu:append(MenuMenu, wxMenuItem:new([ {id, ?menuID_MENU_DELETE}, - {text, "&Delete menu item\tAlt-D"}, + {text, "&Delete menu item\tAlt+D"}, {help, "Delete the last menu item from the last menu"} ])), wxMenu:appendSeparator(MenuMenu), %% -------------------------- wxMenu:append(MenuMenu, wxMenuItem:new([ {id, ?menuID_MENU_ENABLE}, - {text, "&Enable menu item\tAlt-E"}, + {text, "&Enable menu item\tAlt+E"}, {help, "Enable or disable the last menu item"}, {kind, ?wxITEM_CHECK} ])), wxMenu:append(MenuMenu, wxMenuItem:new([ {id, ?menuID_MENU_CHECK}, - {text, "&Check menu item\tAlt-C"}, + {text, "&Check menu item\tAlt+C"}, {help, "Check or uncheck the last menu item"}, {kind, ?wxITEM_CHECK} ])), wxMenu:appendSeparator(MenuMenu), %% -------------------------- wxMenu:append(MenuMenu, wxMenuItem:new([ {id, ?menuID_MENU_GET_INFO}, - {text, "Get menu item in&fo\tAlt-F"}, + {text, "Get menu item in&fo\tAlt+F"}, {help, "Show the state of the last menu item"} ])), wxMenu:append(MenuMenu, wxMenuItem:new([ {id, ?menuID_MENU_SET_LABEL}, - {text, "&Set menu label\tCtrl-S"}, + {text, "&Set menu label\tCtrl+S"}, {help, "Change the label of the last menu"} ])), wxMenu:appendSeparator(MenuMenu), %% -------------------------- @@ -378,9 +378,9 @@ create_stock_menu() -> create_dummy_menu() -> DummyMenu = wxMenu:new(), - wxMenu:append(DummyMenu, ?menuID_DUMMY_FIRST, "&First item\tCtrl-F1"), + wxMenu:append(DummyMenu, ?menuID_DUMMY_FIRST, "&First item\tCtrl+F1"), wxMenu:appendSeparator(DummyMenu), %% -------------------------- - wxMenu:append(DummyMenu, ?menuID_DUMMY_SECOND, "&Second item\tCtrl-F2"), + wxMenu:append(DummyMenu, ?menuID_DUMMY_SECOND, "&Second item\tCtrl+F2"), DummyMenu. loop(State) -> @@ -508,7 +508,7 @@ onMenuAction(#wx{id=?menuID_MENU_APPEND, obj=Frame}, #state{} = State) -> wxMenu:appendSeparator(Menu), wxMenu:append(Menu, wxMenuItem:new([ {id, ?menuID_DUMMY_THIRD}, - {text, "&Third dummy item\tCtrl-F3"}, + {text, "&Third dummy item\tCtrl+F3"}, {kind, ?wxITEM_CHECK} ])), diff --git a/lib/wx/doc/src/wxKeyEvent.xml b/lib/wx/doc/src/wxKeyEvent.xml index 958ed7758f..ce437d36bb 100644 --- a/lib/wx/doc/src/wxKeyEvent.xml +++ b/lib/wx/doc/src/wxKeyEvent.xml @@ -22,13 +22,13 @@ might be impossible to enter on their keyboard. </p><p>Notice that the first rule applies to all Unicode letters, not just the usual Latin-1 ones. However for non-Latin-1 letters only <seemfa marker="#getUnicodeKey/1"><c>getUnicodeKey/1</c></seemfa> can be used to retrieve the key code as <seemfa marker="#getKeyCode/1"><c>getKeyCode/1</c></seemfa> just returns <c>WXK_NONE</c> in this case. </p><p>To summarize: you should handle <c>wxEVT_CHAR</c> if you need the translated key and <c>wxEVT_KEY_DOWN</c> if you only need the value of the key itself, independent of the current keyboard state. </p><p>Note: Not all key down events may be generated by the user. As an example, <c>wxEVT_KEY_DOWN</c> with <c>=</c> key code can be generated using the standard US keyboard layout but not using the German one because the <c>=</c> key corresponds to Shift-0 key combination in this layout and the key code for it is <c>0</c>, not <c>=</c>. Because of this you should avoid requiring your users to type key events that might be impossible to enter on their keyboard. - </p><p> Another difference between key and char events is that another kind of translation is done for the latter ones when the Control key is pressed: char events for ASCII letters in this case carry codes corresponding to the ASCII value of Ctrl-Latter, i.e. 1 for Ctrl-A, 2 for Ctrl-B and so on until 26 for Ctrl-Z. This is convenient for terminal-like applications and can be completely ignored by all the other ones (if you need to handle Ctrl-A it is probably a better idea to use the key event rather than the char one). Notice that currently no translation is done for the presses of [, <c>\</c>, ], <c>^</c> and <c>_</c> keys which might be mapped to ASCII values from 27 to 31. Since version 2.9.2, the enum values <c>WXK_CONTROL_A</c> - <c>WXK_CONTROL_Z</c> can be used instead of the non-descriptive constant values 1-26. + </p><p> Another difference between key and char events is that another kind of translation is done for the latter ones when the Control key is pressed: char events for ASCII letters in this case carry codes corresponding to the ASCII value of Ctrl+Latter, i.e. 1 for Ctrl+A, 2 for Ctrl+B and so on until 26 for Ctrl+Z. This is convenient for terminal-like applications and can be completely ignored by all the other ones (if you need to handle Ctrl+A it is probably a better idea to use the key event rather than the char one). Notice that currently no translation is done for the presses of [, <c>\</c>, ], <c>^</c> and <c>_</c> keys which might be mapped to ASCII values from 27 to 31. Since version 2.9.2, the enum values <c>WXK_CONTROL_A</c> - <c>WXK_CONTROL_Z</c> can be used instead of the non-descriptive constant values 1-26. </p><p>Finally, modifier keys only generate key events but no char events at all. The modifiers keys are <c>WXK_SHIFT</c>, <c>WXK_CONTROL</c>, <c>WXK_ALT</c> and various <c>WXK_WINDOWS_XXX</c> from ?wxKeyCode enum. </p><p>Modifier keys events are special in one additional aspect: usually the keyboard state associated with a key press is well defined, e.g. <seemfa marker="#shiftDown/1"><c>shiftDown/1</c></seemfa> returns <c>true</c> only if the Shift key was held pressed when the key that generated this event itself was pressed. There is an ambiguity for the key press events for Shift key itself however. By convention, it is considered to be already pressed when it is pressed and already released when it is released. In other words, <c>wxEVT_KEY_DOWN</c> event for the Shift key itself will have <c>wxMOD_SHIFT</c> in <seemfa marker="#getModifiers/1"><c>getModifiers/1</c></seemfa> and <seemfa marker="#shiftDown/1"><c>shiftDown/1</c></seemfa> will return true while the <c>wxEVT_KEY_UP</c> event for Shift itself will not have <c>wxMOD_SHIFT</c> in its modifiers and <seemfa marker="#shiftDown/1"><c>shiftDown/1</c></seemfa> will return false. </p><p><c>Tip:</c> You may discover the key codes and modifiers generated by all the keys on your system interactively by running the page_samples_keyboard wxWidgets sample and pressing some keys in it. </p><p>Note: If a key down (<c>EVT_KEY_DOWN</c>) event is caught and the event handler does not call <c>event.Skip()</c> then the corresponding char event (<c>EVT_CHAR</c>) will not happen. This is by design and enables the programs that handle both types of events to avoid processing the same key twice. As a consequence, if you do not want to suppress the <c>wxEVT_CHAR</c> events for the keys you handle, always call <c>event.Skip()</c> in your <c>wxEVT_KEY_DOWN</c> handler. Not doing may also prevent accelerators defined using this key from working. </p><p>Note: If a key is maintained in a pressed state, you will typically get a lot of (automatically generated) key down events but only one key up one at the end when the key is released so it is wrong to assume that there is one up event corresponding to each down one. - </p><p>Note: For Windows programmers: The key and char events in wxWidgets are similar to but slightly different from Windows <c>WM_KEYDOWN</c> and <c>WM_CHAR</c> events. In particular, Alt-x combination will generate a char event in wxWidgets (unless it is used as an accelerator) and almost all keys, including ones without ASCII equivalents, generate char events too. + </p><p>Note: For Windows programmers: The key and char events in wxWidgets are similar to but slightly different from Windows <c>WM_KEYDOWN</c> and <c>WM_CHAR</c> events. In particular, Alt+x combination will generate a char event in wxWidgets (unless it is used as an accelerator) and almost all keys, including ones without ASCII equivalents, generate char events too. </p><p>See: <c>wxKeyboardState</c> (not implemented in wx) </p> <p>This class is derived (and can use functions) from: diff --git a/lib/wx/doc/src/wxMenuBar.xml b/lib/wx/doc/src/wxMenuBar.xml index e90552268a..3969e00140 100644 --- a/lib/wx/doc/src/wxMenuBar.xml +++ b/lib/wx/doc/src/wxMenuBar.xml @@ -18,7 +18,7 @@ setDirection(#wx_ref{type=ThisT}=This,Direction) <description><p>A menu bar is a series of menus accessible from the top of a frame. </p><p>Remark: To respond to a menu selection, provide a handler for EVT_MENU, in the frame that contains the menu bar. </p><p> If you have a toolbar which uses the same identifiers as your EVT_MENU entries, events from the toolbar will also be processed by your EVT_MENU event handlers. - </p><p>Tip: under Windows, if you discover that menu shortcuts (for example, Alt-F to show the file menu) are not working, check any EVT_CHAR events you are handling in child windows. If you are not calling event.Skip() for events that you don't process in these event handlers, menu shortcuts may cease to work. + </p><p>Tip: under Windows, if you discover that menu shortcuts (for example, Alt+F to show the file menu) are not working, check any EVT_CHAR events you are handling in child windows. If you are not calling event.Skip() for events that you don't process in these event handlers, menu shortcuts may cease to work. </p><p>See: <seeerl marker="wxMenu"><c>wxMenu</c></seeerl>, <url href="https://docs.wxwidgets.org/3.1/overview_events.html#overview_events">Overview events</url> </p> <p>This class is derived (and can use functions) from: diff --git a/lib/wx/doc/src/wxNavigationKeyEvent.xml b/lib/wx/doc/src/wxNavigationKeyEvent.xml index 6f6295e509..d621f1bb26 100644 --- a/lib/wx/doc/src/wxNavigationKeyEvent.xml +++ b/lib/wx/doc/src/wxNavigationKeyEvent.xml @@ -46,7 +46,7 @@ setDirection(#wx_ref{type=ThisT}=This,Direction) <func> <name name="isWindowChange" arity="1" clause_i="1" since=""/> - <fsummary>Returns true if the navigation event represents a window change (for example, from Ctrl-Page Down in a notebook). </fsummary> + <fsummary>Returns true if the navigation event represents a window change (for example, from Ctrl+Page Down in a notebook). </fsummary> <desc><p>Returns true if the navigation event represents a window change (for example, from Ctrl-Page Down in a notebook). </p></desc> </func> -- 2.43.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor