Merge lp://staging/~kevang/mnemosyne-proj/number_keys_show_answer into lp://staging/~peter-bienstman/mnemosyne-proj/trunk

Proposed by Kilian Evang
Status: Merged
Merge reported by: Peter Bienstman
Merged at revision: not available
Proposed branch: lp://staging/~kevang/mnemosyne-proj/number_keys_show_answer
Merge into: lp://staging/~peter-bienstman/mnemosyne-proj/trunk
Diff against target: 21 lines (+3/-1)
1 file modified
mnemosyne/mnemosyne/pyqt_ui/review_wdgt.py (+3/-1)
To merge this branch: bzr merge lp://staging/~kevang/mnemosyne-proj/number_keys_show_answer
Reviewer Review Type Date Requested Status
Peter Bienstman Pending
Review via email: mp+234210@code.staging.launchpad.net

Description of the change

In the default review widget, the number keys can be used for showing the answer. While this behavior can be useful, it can also cause unintended showing and even unintended grading when the user accidentally presses a number key two or three times in a row.

This branch makes the abovementioned behavior dependent on the attribute "number_keys_show_answer" so that the behavior can easily be changed by a plugin. This is analoguous to the already existing attribute "auto_focus_grades", which controls the behavior of grading by pressing the space bar.

To post a comment you must log in.
Revision history for this message
Peter Bienstman (peter-bienstman) wrote :

Not sure this is a good idea. I think it's much better to prevent the fact that pressing and holding a number key counts as two presses at the moment. For the enter key, pressing and holding counts as one, so I need to investigate why it does not work for the number keys.

Cheers,

Peter

> -----Original Message-----
> From: <email address hidden> [mailto:<email address hidden>] On Behalf
> Of Kilian Evang
> Sent: 10 September 2014 23:41
> To: <email address hidden>
> Subject: [Merge] lp:~kevang/mnemosyne-
> proj/number_keys_show_answer into lp:mnemosyne-proj
>
> Kilian Evang has proposed merging lp:~kevang/mnemosyne-
> proj/number_keys_show_answer into lp:mnemosyne-proj.
>
> Requested reviews:
> Peter Bienstman (peter-bienstman)
>
> For more details, see:
> https://code.launchpad.net/~kevang/mnemosyne-
> proj/number_keys_show_answer/+merge/234210
>
> In the default review widget, the number keys can be used for showing the
> answer. While this behavior can be useful, it can also cause unintended
> showing and even unintended grading when the user accidentally presses a
> number key two or three times in a row.
>
> This branch makes the abovementioned behavior dependent on the
> attribute "number_keys_show_answer" so that the behavior can easily be
> changed by a plugin. This is analoguous to the already existing attribute
> "auto_focus_grades", which controls the behavior of grading by pressing the
> space bar.
> --
> https://code.launchpad.net/~kevang/mnemosyne-
> proj/number_keys_show_answer/+merge/234210
> You are requested to review the proposed merge of
> lp:~kevang/mnemosyne-proj/number_keys_show_answer into
> lp:mnemosyne-proj.

Revision history for this message
Kilian Evang (kevang) wrote :

> Not sure this is a good idea.

Why not? What's the harm?

I'm not asking to change Mnemosyne's behavior. I'm just asking to make it possible for plugins to change it without overriding keyPressEvent.

> I think it's much better to prevent the fact
> that pressing and holding a number key counts as two presses at the moment.

What if there really are two or more consecutive key presses, for example, by hitting both keys "3" and "4"? Take it from someone to whom this happens *all the time*...

Revision history for this message
Peter Bienstman (peter-bienstman) wrote :

OK, I'll add this to my development branch them, but personally, I don't plan to distribute an official plugin making use of it, since I still think the cleaner approach is fixing the repeat issue, and I don't think people hitting two keys at the same time is an extremely widespread issue.

Feel free to create your own plugin, though :-)

Cheers,

Peter

> -----Original Message-----
> From: <email address hidden> [mailto:<email address hidden>] On Behalf
> Of Kilian Evang
> Sent: 11 September 2014 11:13
> To: <email address hidden>
> Subject: Re: RE: [Merge] lp:~kevang/mnemosyne-
> proj/number_keys_show_answer into lp:mnemosyne-proj
>
> > Not sure this is a good idea.
>
> Why not? What's the harm?
>
> I'm not asking to change Mnemosyne's behavior. I'm just asking to make it
> possible for plugins to change it without overriding keyPressEvent.
>
> > I think it's much better to prevent the fact that pressing and holding
> > a number key counts as two presses at the moment.
>
> What if there really are two or more consecutive key presses, for example,
> by hitting both keys "3" and "4"? Take it from someone to whom this
> happens *all the time*...
> --
> https://code.launchpad.net/~kevang/mnemosyne-
> proj/number_keys_show_answer/+merge/234210
> You are requested to review the proposed merge of
> lp:~kevang/mnemosyne-proj/number_keys_show_answer into
> lp:mnemosyne-proj.

Revision history for this message
Kilian Evang (kevang) wrote :

> OK, I'll add this to my development branch them

Thanks! :)

> Feel free to create your own plugin, though :-)

I alreadyd did: https://github.com/texttheater/clumsy_fingers :D

Revision history for this message
Kilian Evang (kevang) wrote :

The change has been integrated in revision <email address hidden>, so this proposal can be closed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches