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

switch between layouts #79

Open
OrionRandD opened this issue Nov 19, 2019 · 3 comments
Open

switch between layouts #79

OrionRandD opened this issue Nov 19, 2019 · 3 comments

Comments

@OrionRandD
Copy link

OrionRandD commented Nov 19, 2019

It is not really an issue.
But, a PR. Since I am not very familiar with PRs, I had a chat with Xah in his discord channel and asked for him, if possible, to implement a function in xah-fly-keys to change the keyboard layouts on the fly to write documents in emacs in multiple languages. e.g. I need 5 keyboard layouts to write some documents:

  1. qwerty-abnt - which should really be qwerty-abnt2 (the default in Brazil) - the layout is right in xah-fly-keys, but the name is wrong.
  2. qwerty-es (Spain)
  3. qwerty-el (Greek)
  4. qwerry-hr (Hebrew)
  5. qwerty-us --variant intl

I have this setup in my init.el for two languages. I know that xah-fly-keys does not support all the above layouts... sigh! But, even setting emacs for xah-fly-keys to use 2 layouts, I have to comment/uncomment these lines in my init.el and eval one of them to use one or another

(xah-fly-keys-set-layout "qwerty-abnt") ; required
;; (xah-fly-keys-set-layout "qwerty") ; required

So, it is kind of painful...

@xahlee
Copy link
Owner

xahlee commented Nov 20, 2019

perhaps this will solve the problem?

(defun my-toggle-layout ()
"switch between qwerty-abnt and qwerty.
Version 2019-11-20"
(interactive)
(if (string-equal xah-fly-key--current-layout "qwerty")
(setq xah-fly-key--current-layout "qwerty-abnt")
(setq xah-fly-key--current-layout "qwerty")))

@xahlee xahlee changed the title Not an issue But a PR switch between layouts Nov 20, 2019
@OrionRandD
Copy link
Author

@xahlee Thx a lot for the function. I will test it here.
Also. I found out that I can change to many keyboards layouts through Stumpwm, so that emacs respects them when I change them through a combo that I have set up here.
Anyways,
Thx a lot for your time and attention
I will keep visiting your blog. Many thing there to learn...
:)

@OrionRandD
Copy link
Author

@xahlee
I have written an anki file and a pdf for your keybinding. I think it is a way of giving back a little knowledge as well.
Instructions are in the how-to.
If you want to link it to your website, feel free...
Thx again

https://github.com/OrionRandD/dotfiles/tree/master/xah_fly_keys

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