summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog/cmCursesStringWidget.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-04-15 20:11:11 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-04-15 20:11:11 (GMT)
commit685be51a0eff7245a723753e996cdc6be9f37ea2 (patch)
tree5e5ed443298c900c6286bd7f7fdfef4798e457ba /Source/CursesDialog/cmCursesStringWidget.cxx
parent0986b42761f501d58b17e3fabe238da636ca2d11 (diff)
downloadCMake-685be51a0eff7245a723753e996cdc6be9f37ea2.zip
CMake-685be51a0eff7245a723753e996cdc6be9f37ea2.tar.gz
CMake-685be51a0eff7245a723753e996cdc6be9f37ea2.tar.bz2
ENH: Add support for HOME and END keys. Also fix Bug #666 - In CCMake when deleting something, it does not stop at the beginning of line
Diffstat (limited to 'Source/CursesDialog/cmCursesStringWidget.cxx')
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index 31ed312..ccdb446 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -162,18 +162,21 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
{
form_driver(form, REQ_CLR_EOL);
}
- else if ( key == ctrl('a') )
+ else if ( key == ctrl('a') || key == KEY_HOME )
{
form_driver(form, REQ_BEG_FIELD);
}
- else if ( key == ctrl('e') )
+ else if ( key == ctrl('e') || key == KEY_END )
{
form_driver(form, REQ_END_FIELD);
}
else if ( key == ctrl('d') || key == 127 ||
key == KEY_BACKSPACE || key == KEY_DC )
{
- form_driver(form, REQ_DEL_PREV);
+ if ( form->curcol > 0 )
+ {
+ form_driver(form, REQ_DEL_PREV);
+ }
}
else
{