Skip to content

Commit

Permalink
Fixed a hotkey issue that was not enabling reassign a key.
Browse files Browse the repository at this point in the history
Part of the issue was intruduced when I fixed the problem related to hotkey
issues related to Tweak menu.
8976740

NOTE:
Fixed a hotkey issue that was not enabling replace a previous binded key as
well as it was ignoring the hotkey deletion. Thanks ggaliens.
  • Loading branch information
Micheus authored and dgud committed May 18, 2016
1 parent 3f544ef commit a8beb6c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/wings_hotkey.erl
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,19 @@ hotkey_key_message(Cmd) ->


bind_from_event(Ev, Cmd) ->
Bkey0 = bindkey(Ev, Cmd),
Bkey = case Bkey0 of
{bindkey, _Key1} -> Bkey0;
{bindkey, _Mode, Key1} -> {bindkey, Key1}
end,
{bindkey, Key} = Bkey,
ets:insert(?KL, {Bkey,Cmd,user}),
Bkey = bindkey(Ev, Cmd),
Key = case Bkey of
{bindkey, Key1} -> Key1;
{bindkey, _Mode, Key1} -> Key1
end,
ets:insert(?KL, {Bkey,Cmd,user}),
format_hotkey(Key, wx).


unbind({Key}) ->
unbind(Key);
unbind(Key) ->
ets:delete(?KL, {bindkey, Key}).
ets:delete(?KL, Key).

hotkeys_by_commands(Cs) ->
hotkeys_by_commands_1(Cs, []).
Expand All @@ -221,7 +220,7 @@ hotkeys_by_commands_2([{Key0,Cmd,Src}|T]) ->
{bindkey,Key1} -> Key1;
{bindkey,_Mode,Key1} -> Key1
end,
Info = {Key,format_hotkey(Key, wx),wings_util:stringify(Cmd),Src},
Info = {Key0,format_hotkey(Key, wx),wings_util:stringify(Cmd),Src},
[Info|hotkeys_by_commands_2(T)];
hotkeys_by_commands_2([]) -> [].

Expand Down

0 comments on commit a8beb6c

Please sign in to comment.