Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
e0c4f9c5
Commit
e0c4f9c5
authored
9 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
input: give more detailed feedback when an unbound key is struck
parent
eb871e72
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/browser.c
+2
-1
src/browser.c
src/help.c
+2
-1
src/help.c
src/nano.c
+17
-2
src/nano.c
src/proto.h
+1
-0
src/proto.h
with
22 additions
and
4 deletions
+22
-4
src/browser.c
View file @
e0c4f9c5
...
...
@@ -332,7 +332,8 @@ char *do_browser(char *path, DIR *dir)
}
else
if
(
func
==
do_exit
)
{
/* Exit from the file browser. */
break
;
}
}
else
unbound_key
(
kbinput
);
}
titlebar
(
NULL
);
edit_refresh
();
...
...
This diff is collapsed.
Click to expand it.
src/help.c
View file @
e0c4f9c5
...
...
@@ -161,7 +161,8 @@ void do_help(void)
}
else
if
(
func
==
do_exit
)
{
/* Exit from the help viewer. */
break
;
}
}
else
unbound_key
(
kbinput
);
}
if
(
old_no_help
)
{
...
...
This diff is collapsed.
Click to expand it.
src/nano.c
View file @
e0c4f9c5
...
...
@@ -1563,6 +1563,22 @@ void terminal_init(void)
#endif
}
/* Say that an unbound key was struck, and if possible which one. */
void
unbound_key
(
int
code
)
{
if
(
func_key
)
statusbar
(
_
(
"Unbound key"
));
else
if
(
meta_key
)
{
if
(
0x60
<
code
&&
code
<
0x7B
)
code
-=
0x20
;
statusbar
(
_
(
"Unbound key: M-%c"
),
code
);
}
else
if
(
code
<
0x20
)
statusbar
(
_
(
"Unbound key: ^%c"
),
code
+
0x40
);
else
statusbar
(
_
(
"Unbound key: %c"
),
code
);
beep
();
}
/* Read in a character, interpret it as a shortcut or toggle if
* necessary, and return it.
* If allow_funcs is FALSE, don't actually run any functions associated
...
...
@@ -1612,8 +1628,7 @@ int do_input(bool allow_funcs)
* function key, and it's not a shortcut or toggle, throw it out. */
if
(
!
have_shortcut
)
{
if
(
is_ascii_cntrl_char
(
input
)
||
meta_key
||
func_key
)
{
statusbar
(
_
(
"Unknown Command"
));
beep
();
unbound_key
(
input
);
meta_key
=
FALSE
;
func_key
=
FALSE
;
input
=
ERR
;
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
e0c4f9c5
...
...
@@ -498,6 +498,7 @@ void enable_signals(void);
void
disable_flow_control
(
void
);
void
enable_flow_control
(
void
);
void
terminal_init
(
void
);
void
unbound_key
(
int
code
);
int
do_input
(
bool
allow_funcs
);
#ifndef DISABLE_MOUSE
int
do_mouse
(
void
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help