summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog/cmCursesBoolWidget.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CursesDialog/cmCursesBoolWidget.cxx')
-rw-r--r--Source/CursesDialog/cmCursesBoolWidget.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx
index 0055e88..e36ac34 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.cxx
+++ b/Source/CursesDialog/cmCursesBoolWidget.cxx
@@ -27,8 +27,9 @@ cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left,
bool cmCursesBoolWidget::HandleInput(int& key, cmCursesMainForm*, WINDOW* w)
{
+ // toggle boolean values with enter or space
// 10 == enter
- if (key == 10 || key == KEY_ENTER) {
+ if (key == 10 || key == KEY_ENTER || key == ' ') {
if (this->GetValueAsBool()) {
this->SetValueAsBool(false);
} else {
@@ -54,9 +55,5 @@ void cmCursesBoolWidget::SetValueAsBool(bool value)
bool cmCursesBoolWidget::GetValueAsBool()
{
- if (this->Value == "ON") {
- return true;
- } else {
- return false;
- }
+ return this->Value == "ON";
}