Opened 16 years ago
Closed 15 years ago
#3971 closed enhancement (fixed)
Patch: enable mixed mouse+keyboard input in Sudoku
Reported by: | Stef | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications/Sudoku | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Currently, Sudoku supports either mouse input (point at cell, click to insert numbers) or keyboard input (arrow keys select cell, type numbers to insert them). When attempting to combine the two (point to select cells, type a number to insert it) weird things happen.
The first keypress selects the cell under the mouse cursor (blue outline). The second keypress inserts the number in this cell. However, when forcing a repaint (drag the window off the screen and back), it can be seen that the first keypress inserts the number at the previous keyboard position without updating the screen.
The attached patch does not address the repaint issue directly. Instead, it always sets the keyboard input position to the mouse input position (if valid). Not only does this solve this issue, it also enables mixed input as described above (point and type).
Attachments (1)
Change History (4)
by , 16 years ago
Attachment: | sudoku.patch added |
---|
comment:1 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Applied in hrev30918. Thanks a lot!
comment:2 by , 15 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Thanks, but the modified patch applied in hrev30918 still fails when _GetFieldFor returns true but one of the other clauses in the if statement on lines 850-852 passes. This can be seen for instance when there is a number in the cell pointed to by the mouse; it is not possible to change this number with the point-and-type method, as any numbers typed appear in the previous empty cell pointed to.
Moving the assignments above the if statement (but obviously after the _GetFieldFor call) as in my original patch allows numbers to be changed without such unexpected behavior.
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Sorry about that! I will try to be more careful next time!
patch for SudokuView.cpp (against hrev30866)