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

Is custom hotkey assignment still working? #3066

Open
3 tasks done
jrbastien opened this issue May 7, 2017 · 6 comments
Open
3 tasks done

Is custom hotkey assignment still working? #3066

jrbastien opened this issue May 7, 2017 · 6 comments

Comments

@jrbastien
Copy link
Contributor

I am currently updating the documentation for translating FontForge user interface on fontforge.github.io and when testing the instructions for changing the assignment of Hot Keys I can't make it work.

I have create a custom FontForge-MenuShortCuts.mo and moved it to my locale directory (/usr/local/share/locale/fr/LC_MESSAGES). But when starting FontForge, it does not load my changes (I have assigned Ctl+Shft+Z to Redo and translated Shift to Maj). The French translation that is in this directory is used so I know that my system is set properly to use this locale info.

r a 82 de untitled1 latin capital letter r_196

  • The FontForge version and the operating system you're using
    Ubuntu 16.04 Fontforge 23:15 Manually built on March 28th 2017

  • The behavior you expect to see, and the actual behavior
    I'm expecting to use Ctrl+Shift+Z as the undo key. Shift should be replaced by Maj in the menu. It still uses Ctrl+Y and Shift does not change to Maj.

  • Steps to reproduce the behavior
    Use the attached pot file, compile it and move it to your locale folder. Restart fontforge and verify if it uses the new shortcut.

fr-MenuShortCuts.po.zip

@jtanx
Copy link
Contributor

jtanx commented May 7, 2017

I think hotkey setting does work, but you need to modify your hotkeys file, usually under ~/.config/fontforge/hotkeys. The default hotkeys file is under /usr/local/share/fontforge/hotkeys/default.

The format is something like:

...
FontView.Popup.Menu.Correct Direction:Ctrl+Shift+D
FontView.Popup.Menu.AutoHint:Ctrl+Shift+H
...

As for localisation of Shift->Maj, I'm unsure if that's still supported or not.

@jrbastien
Copy link
Contributor Author

Thank you @jtanx . You are right this is how it is done now. I see that the local documentation was updated but not http://fontforge.github.io/. But this is exactly what I am working on right now so it should be fixed soon.

Sad to see though that it is no longer translating shortcut keys :(

@jrbastien
Copy link
Contributor Author

I see that doc/html/HotKeys.html still refers to gettext in the middle of the text to reconfigure hotkeys although there is a complete section explaining the use of the hotkey file.

I will submitt a pull request to fix that.

@jrbastien jrbastien reopened this May 8, 2017
@JoesCat
Copy link
Contributor

JoesCat commented May 8, 2017

Hi @jrbastien,

Sad to see though that it is no longer translating shortcut keys :(

Shortcut keys are hard to decide if they should be localized, or if they should be global (example: CTRL+F work the same for all languages). If global, then we only really need one po file, but if it's going to be localized, we more-or-less need to duplicate the for loop structure and other stuff found in the Makefile.am seen in the po directory.
How is this handled in other general software? For example, say built-in NOTEPAD, built-in WORDPAD, and other built-in programs in Window? or how about the MAC? or is there maybe a combination of standardizations/localizations used (example CTRL+C, CTRL+V, etc)?

If there are questions, I usually refer back to 20120731 for ideas because the configure/makefile system had a major overhaul after 20120731 which fixed a number of stagnant problems, but also created new problems that needed/need fixing - at this point in time, some things are still broken things.

@jrbastien
Copy link
Contributor Author

jrbastien commented May 8, 2017

@JoesCat, @jtanx thanks for clarification/questions. I know that George Williams has done it with a separate pot file (FontForge-MenuShortCuts.po) but why not simply add these few keys to the standard pot file? What would it take to have them show in this file and be used?

Here is an element of answer: Theme based hotkeys for...

Separately, while I'm updating the documentation I would like to provide a table showing the various locations of the hotkey files. Is there a destination for the MAC keys or they just can be edited in the default file?

OS Source Destination
Linux /usr/local/share/fontforge/hotkeys/default ~/.config/fontforge/hotkeys
Mac /Applications/FontForge.app/Contents/Resources/opt/local/share/fontforge/hotkeys/default
Windows %programfiles(x86)%\FontForgeBuilds\share\fontforge\hotkeys\default %userprofile%\AppData\Roaming\FontForge\hotkeys

@jtanx
Copy link
Contributor

jtanx commented May 8, 2017

On my osx vm, I can see ~/.config/fontforge/hotkeys, so it probably can work from there too.

Yeah I seem to recall what drove the hotkey change was because on macs you use cmd instead of ctrl most of the time, and I guess looking at the comments from that thread you linked to, the gettext option was considered a hack. I don't really know tbh. Some further interesting reading is looking at the PR history https://github.com/fontforge/fontforge/pulls?utf8=%E2%9C%93&q=is%3Apr%20is%3Aclosed%20hotkey%20

@skef skef self-assigned this Mar 19, 2019
@skef skef removed their assignment Nov 23, 2019
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

4 participants