Ticket #15 (closed defect: fixed)

Opened 8 months ago

Last modified 8 months ago

MOD1 MOD2 MOD3 not set

Reported by: baxissimo Assigned to: keinfarbton
Priority: major Milestone: dwt-win-3.3-01
Component: dwt-win Version:
Keywords: Cc:

Description

There's some code in DWT.d that would set the values of the modifier keys if it weren't commented out. The comment implies they are supposed to get set elsewhere, but grepping through the source, I can't find anywhere that's happening.

The result is that in samples like dwtexamples/texteditor which set accelerator keys on menus, the accelerators get triggered by plain keypresses. I.e. a plain 'v' key does a paste operation rather than inserting a 'v' in the text widget.

Change History

04/07/08 00:32:26 changed by baxissimo

Same goes for MODIFIER_MASK and BUTTON_MASK.

I tried just setting those values to what they are supposed to be in DWT.d and it seems to work ok. I.e. I have these lines inside DWT {...} now:

    public static const int BUTTON_MASK = BUTTON1 | BUTTON2 | BUTTON3 | BUTTON4 | BUTTON5;
    public static const int MOD1 = CONTROL;
    public static const int MOD2 = SHIFT;
    public static const int MOD3 = ALT;
    public static const int MODIFIER_MASK = ALT | SHIFT | CTRL | COMMAND;

With that everything seems happy. But the comment in the code is talking about worries about the compiler inlining the constants. I don't think that's really something that the D version has to worry about, but I could be wrong.

04/07/08 07:11:07 changed by keinfarbton

Ok, i fixed the initialization. Does it work for you now? I don't have the time to test it atm.

04/08/08 20:30:25 changed by baxissimo

  • status changed from new to closed.
  • resolution set to fixed.

The fix works for me.