diff --git a/field.py b/field.py index c74a171..25cb5de 100644 --- a/field.py +++ b/field.py @@ -19,6 +19,10 @@ class Field: self.message = '' + def toggleCurrent(self): + curline = self.field[self.cursor[0]] + curline[self.cursor[1]] = 0 if curline[self.cursor[1]] == 1 else 1 + def print_field(self,stdscr): stdscr.clear() for line in range(0,len(self.field)): diff --git a/r4matrixed.py b/r4matrixed.py index fff0870..d4634b6 100755 --- a/r4matrixed.py +++ b/r4matrixed.py @@ -32,6 +32,8 @@ def inputLoop(stdscr): match key: case 'q': exitPrg = True + case ' ': + field.toggleCurrent() case 'KEY_DOWN': if field.cursor[0] < len(field.field)-1: newcursor = (field.cursor[0] +1,field.cursor[1])