• Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Social Media
    •   @Wings3dOfficial
    •   @Wings3dOfficial
    •   Wings3dOfficial
    •   Wings3dOfficial
  • Register
  • Login
  • Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Register
  • Login
Wings 3D Development Forum Wings 3D Bug Reports v
« Previous 1 … 23 24 25 26 27 … 35 Next »
[fixed] Why CTRL+R not equal to MMB ?

 
  • 0 Vote(s) - 0 Average
[fixed] Why CTRL+R not equal to MMB ?

micheus
Offline

Forum's Admin and Support | Bug fixer
Posts: 3,680
Threads: 184
Joined: Jun 2012
#6
10-30-2015, 07:31 AM (This post was last modified: 10-30-2015, 07:59 AM by micheus.)
ggaliens, it will not work since only the coordinate returned by this function is used by wings_menu module (called in two places).

I took a look on it and it needs to be managed in the popup_events handler. There, the second bind option for receive will process the mouse button for the item selected and it's processing only the three buttons returned in the #wxMouse{type=What} => What -> left_up,middle_up and right_up.

As I believe it should to process the mouse buttons as in the preferences, we need to check for num_buttons value and handle the translations to One and Two buttons (not only Two).

The workaround/fix I did works fine, but we can get a side effect when using One button: Alt+click in Flip command is intend to duplicate the object before flip it. Smile

Here is the code from wings_menu.erl in case you want to evaluate it. The changes/adds are signed with [*** xxxx ***].

Code:
:
popup_events(Dialog, Panel, Entries, Magnet, Previous, Ns, Owner) ->
    receive
    #wx{id=Id, obj=Obj, event=#wxMouse{type=enter_window}} ->
        Set = fun() ->
:
    #wx{id=Id0, event=Ev=#wxMouse{type=_What, y=Y, x=X}} ->     [*** changes here ***]
        Id = case Id0 > 0 orelse find_active_panel(Panel, X, Y) of
             true -> Id0;
             {false, _} = No -> No;
             {AId, _} -> AId
         end,
            What = mouse_button(Ev),     [*** That is new ***]
        case Id of
        {false, outside} when What =:= right_up ->
            wxPopupTransientWindow:dismiss(Dialog),
            wings_wm:psend(Owner, restart_menu);
        {false, _} ->
:
        end;
    #wx{event=#wxShow{}} ->
:
    end.
:
:
mouse_index(left_up) -> 1;
mouse_index(middle_up) -> 2;
mouse_index(right_up) -> 3.

[*** That is new ***]
mouse_button(#wxMouse{type=What, controlDown = Ctrl, altDown = Alt, metaDown = Meta}) ->
        case wings_pref:get_value(num_buttons) of
            1 ->
                case {What,Alt,Ctrl} of
                    {left_up,true,false} -> middle_up;
                    {left_up,false,true} -> right_up;
                    _ -> What
                end;
            2 ->
                case {What,(Ctrl or Meta)} of
                    {right_up,true} -> middle_up;
                    _ -> What
                end;
            _ -> What
        end.
[Image: tw.png] @MicheusVieira [Image: yt.png] @MicheusVieira [Image: da.png] Micheuss [Image: ig.png] micheus4wings3d
* Wings3D Team stands for: Björn and Dan
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Messages In This Thread
[fixed] Why CTRL+R not equal to MMB ? - by ggaliens - 10-23-2015, 03:26 PM
RE: Why CTRL+R not equal to MMB ? - by micheus - 10-23-2015, 03:38 PM
RE: Why CTRL+R not equal to MMB ? - by micheus - 10-23-2015, 03:42 PM
RE: Why CTRL+R not equal to MMB ? - by ggaliens - 10-23-2015, 03:50 PM
RE: [ggaliens] Why CTRL+R not equal to MMB ? - by ggaliens - 10-30-2015, 02:27 AM
RE: [ggaliens] Why CTRL+R not equal to MMB ? - by micheus - 10-30-2015, 07:31 AM
RE: [ggaliens] Why CTRL+R not equal to MMB ? - by ggaliens - 10-30-2015, 02:27 PM
RE: [ggaliens] Why CTRL+R not equal to MMB ? - by micheus - 10-30-2015, 03:33 PM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode