Ticket #3075 (closed enhancement: fixed)

Opened 3 years ago

Last modified 6 months ago

Make hotkey Ctrl+Shift+Enter re-configurable

Reported by: spacekpe Owned by: andrew_b
Priority: major Milestone: 4.8.18
Component: mc-key-bindings Version: master
Keywords: Cc: spacekpe
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

I would like to have Ctrl+Shift+Enter hotkey re-configurable.

If I read the code correctly, it is hardcoded in src/filemanager/midnight.c function midnight_callback() around line 1482:

1482         /* Ctrl-Shift-Enter */                                                  
1483         if (parm == (KEY_M_CTRL | KEY_M_SHIFT | '\n'))                          
1484         {                                                                       
1485             midnight_put_panel_path (current_panel);                            
1486             put_prog_name ();                                                   
1487             return MSG_HANDLED;                                                 
1488         }

I could try to contribute the patch if you give me a pointer to place where configurable hot keys are handled some preferred way.

Have a nice day!

Change History

comment:1 in reply to: ↑ description Changed 3 years ago by andrew_b

Replying to spacekpe:

I would like to have Ctrl+Shift+Enter hotkey re-configurable.

If I read the code correctly, it is hardcoded in src/filemanager/midnight.c function midnight_callback() around line 1482:

1482         /* Ctrl-Shift-Enter */                                                  
1483         if (parm == (KEY_M_CTRL | KEY_M_SHIFT | '\n'))                          
1484         {                                                                       
1485             midnight_put_panel_path (current_panel);                            
1486             put_prog_name ();                                                   
1487             return MSG_HANDLED;                                                 
1488         }

Unfortunately, the key handling in file panels (midnight_dlg dialog) and in some other places was not fully rewritten in #212. The legacy hardcoded shortcuts should be removed and configurable shortcuts should be used as much as possible.

I could try to contribute the patch if you give me a pointer to place where configurable hot keys are handled some preferred way.

See lib/keybind.[ch], src/keybind-defaults.[ch], midnight_execute_cmd() and misc/mc.*.keymap.

comment:2 follow-up: ↓ 3 Changed 6 months ago by mooffie

This is a duplicate of #3664.

comment:3 in reply to: ↑ 2 Changed 6 months ago by andrew_b

Replying to mooffie:

This is a duplicate of #3664.

No. we can use 001-3664-don-t-hardcode-X-enter.patch from there.

comment:4 Changed 6 months ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • Branch state changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.18

comment:5 Changed 6 months ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:6 Changed 6 months ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:7 Changed 6 months ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.