From b4ad8b37b839a0d3a941c81f3ccac22b217b3d34 2007-03-31 15:51:51 From: walter.doerwald Date: 2007-03-31 15:51:51 Subject: [PATCH] Map the return key to enter() and shift-return to enterattr(). --- diff --git a/IPython/Extensions/igrid.py b/IPython/Extensions/igrid.py index 13550e3..ca0f180 100644 --- a/IPython/Extensions/igrid.py +++ b/IPython/Extensions/igrid.py @@ -391,7 +391,7 @@ class IGridGrid(wx.grid.Grid): keycode = event.GetKeyCode() if keycode == ord("P"): row = self.GetGridCursorRow() - if event.ShiftDown(): + if sh: col = self.GetGridCursorCol() self.pickattr(row, col) else: @@ -404,13 +404,13 @@ class IGridGrid(wx.grid.Grid): self.pickrows(sorted(self.current_selection)) elif keycode in (wx.WXK_BACK, wx.WXK_DELETE, ord("X")) and not (ctrl or sh): self.delete_current_notebook() - elif keycode == ord("E") and not (ctrl or sh): - row = self.GetGridCursorRow() - self.enter(row) - elif keycode == ord("E") and sh and not ctrl: + elif keycode in (ord("E"), ord("\r")): row = self.GetGridCursorRow() - col = self.GetGridCursorCol() - self.enterattr(row, col) + if sh: + col = self.GetGridCursorCol() + self.enterattr(row, col) + else: + self.enter(row) elif keycode == ord("E") and ctrl: row = self.GetGridCursorRow() self.SetGridCursor(row, self.GetNumberCols()-1) diff --git a/doc/ChangeLog b/doc/ChangeLog index 6174f60..ed497b2 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2007-03-31 Walter Doerwald + + * IPython/Extensions/igrid.py: Map the return key + to enter() and shift-return to enterattr(). + 2007-03-30 Fernando Perez * IPython/Magic.py (magic_psearch): add unicode support by