Towards an easier Lozenge command character on Windows
#73
Closed
opened 10 years ago by maphew
·
12 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Typing the lozenge command character
◊
on Windows with Alt-nnnn is tedious at best, and doubly so on a laptop that doesn't have a numpad, and impossible on one without numlock at all.There has to be a better way.
Command Overview has a note about using
world:command-marker
to configure the command character to something else (though where to define is left as an exercise for the reader). It's sub-optimal because it will make it harder to work collaboratively with others.I got excited when I saw a post about enabling and using
AltGr
for a subset of Alt-codes, but lozenge doesn't seem to be in the Wikipedia list. (Which is what makes it good as a command character in the first place, it doesn't get used.)What I'll probably do is leverage AutoHotKey and bind double-tap [some-key] (ref). This works for me because I'm using AHK already, others might find that as too much friction. I opened this issue in case someone has a better solution I haven't thought of?
You can override the command character on a per-project basis using a
config
submodule in your"directory-require.rkt"
file. You are correct, however, that there ought to be a cross-reference in the “Command Overview” docs (and now, there is).As for the ergonomics, I acknowledge that the lozenge is not easy to type (even on a Mac keyboard — I use a utility called Typinator to assign it to a more convenient location).
BTW the instructions to change the command char.
Thank you for documentation (and promptness!)
Here's a working AHK script to have double-tap back-tick send the lozenge character. It took way more time than I want to think about, once started I couldn't let go.
Nice. Is this something I could add to the docs?
Yes, certainly. I'm honored to help.
Perhaps this is a DrRacket feature addition (of which I know little about), but perhaps you could create a menu item for the lozenge character and bind it to a keypress. I imagine this would be enabled through a Racket package. It could go something like... "Insert > Lozenge"
This probably isn't the answer you wanted, but if you're using Emacs, I tried to write a tiny function that inserts the lozenge character. I chose M-\ because that's the key for the lambda character in DrRacket.
Hmmm ... I found that this lozenge was extremely off-putting to me trying Pollen.
So I'm trying a keybinding. I created a file called keys.rkt
and loaded it into drracket with Edit>Keybindings>Add user defined keybindings
Now I can use ctrl-shift-< to put the lozenge in.
I'm not a drracket expert so I don't know if it's possible to automatically load this keybinding into #lang pollen though.
You can change the lozenge to anything you want by overriding the
command-char
for your project. Documented here.There's a button in the DrRacket toolbar that will insert the lozenge (or whatever the command character is). I don’t think I will impose a specific keybinding since that tends to be more a matter of personal preference.
Won't changing to a custom symbol risk breaking copy / pasting between different users' code / books if one prefers not to use the lozenge?
I understand not wanting to impose specific keybinding. But it's maybe worth documenting this for drracket users, just as you're doing for emacs?
regards
Phil
No one has reported that as a problem.
I will add it to the list of doc edits.
I'm so glad I finally found this thread. I've been reading Pollen docs for a couple of weeks, but I use a MacBook Pro, so the lozenge issue has been nagging me in a bad way.
I didn't really want to change the default character, as that means whatever I write isn't something that will work out of the box if I share it.
I use a utility called Karabiner to give me the lacking forward delete key (I find that I never use the right-Opt key in practice). The trouble with Karabiner is that it has a bewildering set of capabilities, and even profiles for different applications - but it's hard to understand and I don't see a way to map to an arbitrary character such as lozenge. It also might prove problematic for people who use multiple language keyboard mappings.
There aren't a lot of useless keys left on the MBP, and I didn't like the idea of re-mapping a key, as outside the context of Pollen, it makes that key useless.
What I was hoping to do was use a digraph, such as <>, that automagically converts to a lozenge in my editor - not far from the way Sublime automatically closes "(". This should not happen, of course outside of that context, for example, when writing SQL.
Perhaps there is a way to do this in Dr. Racket.
Or perhaps there is a function that will take a defined command-string "<>" and convert new occurrences and write them as ◊
Please post your question to the Pollen mailing list.