Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for command to list active key-bindings in nedit-ng #185

Open
grege2 opened this issue Nov 22, 2020 · 6 comments
Open

Request for command to list active key-bindings in nedit-ng #185

grege2 opened this issue Nov 22, 2020 · 6 comments

Comments

@grege2
Copy link

grege2 commented Nov 22, 2020

Hi, going great with nedit-ng here on MacOS Catalina, I've restored about 98% of everything I used routinely in X/Motif nedit.

A Request For Enhancement .. it would be nice to be able to dump the currently active key-bindings in nedit-ng, ie. the built-in bindings, and any that have been added in the user's own macros. Example: I've added back in my old familiar Emacs basic bindings:

Ctrl A - beginning_of_line()
Ctrl E - end_of_line()
Ctrl J - delete_to_start_of_line()   // I'm not sure there was ever a totally standard binding for that
Ctrl K - delete_to_end_of_line()

I contemplated using the Cmnd key, but of course Cmnd A,E,J,K are in use. In fact I'm happy to use the Ctrl modifier for these bindings so that's fine. But regardless it would be handy to be able to dump the current bindings, and see what has been used already. Especially if some macro key binding is playing up and you suspect a conflict.

As an aside, the Default Settings > Customise Menus > Macro Menu... dialog is working beautifully. I'm sure it wasn't easy to port all that Motif hackery to Qt. In fact I gave up using that Dialog years ago, it never seemed to work well for me, and I just edited directly into nedit.rc, with precautions to not get code over-written etc. It's great to go back to a smoothly working Dialog. It even understands the Mac Fn keys, eg. F11, F12 which I use for some macros.

Ciao, GE.

@grege2
Copy link
Author

grege2 commented Nov 22, 2020

Since writing the above, I have stumbled on some more bindings:

fn left-arrow    start of line
fn right-arrow   end of line
fn up-arrow      up a page
fn down-arrow    down a page

cmd left-arrow   back a word
cmd right-arrow  fwd a word
cmd up-arrow     up a paragraph
cmd down-arrow   down a paragraph

shift up/dn/left/right-arrow   extend the selection 

I haven't seen these bindings documented, but I could easily have missed it. Anyway, it would be cool to have a full list.

Cheers.

@eteran
Copy link
Owner

eteran commented Nov 23, 2020

Sure thing, this actually should be pretty easy to do.

Do note, that the Cmd and Fn ones aren't ones explicitly set by nedit, but are instead generated by macOS. For example, not all keyboards have a "PageDown" button, so macOS simulates that key binding via "Cmd+Down". Any listing I can give would show the bindings from nedit's point of view only. (aka "PageDown")

@eteran
Copy link
Owner

eteran commented Nov 23, 2020

Note, I am contemplating a good config system for letting users specify the key bindings for EVERYTHING themselves (if they like), it just gets tricky with the "Shift" modified ones.

Do I just assume that anything specified which as an inverse operation implicitly has a shift version? Do I let the shift versions be set seperately? Not always easy to say which is "better"

@grege2
Copy link
Author

grege2 commented Nov 23, 2020

Ah yes, I'd forgotten that Windows has a Page-Up and Page-Down key. And Home and End which would be a good binding for Begin/End of file. And of course it has a proper Backspace -and- Delete key, I do miss having both those on Mac.

Re Shift-modifier, hmm, Shift is a well-known prefix for "reverse", but .. here's me wanting Ctrl-A and Ctrl-E for begin/end of line. I wouldn't want and Shift+.

@grege2
Copy link
Author

grege2 commented Nov 23, 2020

Arggh. MarkDown ate my comment. I meant SOMEKEY and SHIFT+SOMEKEY.
Note to self - always Preview.

@grege2
Copy link
Author

grege2 commented Dec 22, 2020

HI, just reviewing issues. My request for a list of active key bindings was pretty much general laziness, while getting nedit-ng going on my Mac. Plus there's the Mac confusion of Cmd becomes Meta, and Alt becomes Ctrl (or whatever it is .. more laziness). But with the benefit of some experience poking around the code, it feels like, without a centralised keystroke dispatcher, it could be awkward to dump the active key bindings. But if you go ahead with the completely user-configurable system you mentioned above, it would be easy I guess. Anyway, if you want to change this issue to a background "todo list" thing that's fine for me. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants