[done] Mac keybindings

Request Features and Feature Changes

[done] Mac keybindings

Postby elephantum » Sat Aug 09, 2008 4:34 pm

Hi!

I'd like to see common Mac keybindings implemented in Editra.

Alt-Left/Right for moving by words, Cmd-Left for start of the line, Cmd-Right for end of the line and so on.
Complete list:
http://www.danrodney.com/mac/index.html ("working with text" section)

As far as I understood I need to implement MacKeyHandler in ed_keyh module, is this the right way to do it?
elephantum
Limited User
 
Posts: 2
Joined: Sat Aug 09, 2008 4:27 pm

Postby cody » Sat Aug 09, 2008 5:15 pm

No, it could be done that way but that would require more work.

To achieve this I need to add some actions that can have shortcuts bound to them. Currently I am just using the text controls builtin bindings for these actions so they are not currently configurable. The Scintilla text control uses the following keys for these actions.

Word Right: Ctrl+Right Arrow Key
Word Left: Ctrl+Left Arrow Key
Line Start: Home Key (Fn+Left Arrow)
Line End: End Key (Fn+Right Arrow)

I plan to add actions for these but just haven't got around to implementing it yet.

Cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Postby elephantum » Mon Aug 11, 2008 12:03 pm

I'd like to help on this task. Without it done I just cannot use Editra without frustration.

If you can give a hint on implementing, I'd like rather do it myself and send a patch then just sit and wait.
elephantum
Limited User
 
Posts: 2
Joined: Sat Aug 09, 2008 4:27 pm

Postby cody » Mon Aug 11, 2008 12:58 pm

Here is what I purpose:

Warning this area of the code is a dire need of a redesign/rewrite but here is what needs to be done to get it in the system for now.


1) In ed_menu.py make a new submenu (Navigation)
2) Not sure at the moment what location is most appropriate but here are my top two thoughts at the moment.
    Edit Menu under Bookmarks
    View Menu under Goto Matching Brace
Eventually I plan to hook the non menu driven commands into the keybinding configuration but for now they need to be in the menus to work in the system.
3) If you give the items default shortcuts they also need to be added to the default keybinding dictionary in that file, make sure there is no conflicts with existing keys and please discuss and changes to existing bindings beforehand.


For each menu item added to the new submenu you will need to add a new ID in the appropriate location in ed_glob.py. These ID's will also need to be added to the __all__ set at the top of the file.

3) In ed_main.py bind the menu events
This is done in the __init__ method with a tuple (ID_SOMETHING, DispatchToControl).
4) in ed_main DispatchToControl add your ID's to the accepted menu_ids list

5) In ed_stc.py ControlDispatch, add a mapping of the menu ID to the function to call, if the function requires an argument then it needs to be handled separatly farther down in this method. The text buffer has builtin commands for almost any kind of navigation so you shouldn't need to implement any new methods, see the StyledTextCtrl documentation at wxpython.org and or just do a dir on wx.stc.StyledTextCtrl for information about the available methods.

That should do it.

If you make a patch please make it as a Unified Diff against the latest svn.

Thanks,

Cody[/list]
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Postby cody » Wed Oct 29, 2008 3:53 am

Hello,

Standard bindings for most of the cursor movement commands have been added. Only a few more to go. For further information on the progress of this feature please view the following ticket.

http://code.google.com/p/editra/issues/detail?id=171
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Postby Ross » Thu Oct 30, 2008 4:41 pm

Hey - This must be my lucky day. I've been using Editra for HTML for a few months, and for some django and ajax stuff for a week or two, and finally thought - I should register to ask for a fix to a small, but frustrating thing - the alt-left/right word hop thing.... and here I see it's done! And yesterday! Ha.

There is one other request - I'll post that separately - about screen position on opening...

Thx for the nice and rapidly improving tool that is Editra!

-Ross
Ross
User
 
Posts: 30
Joined: Thu Oct 30, 2008 4:31 pm


Return to Feature Requests

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron