stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [STUMP] Changing keyboard layout... forth and back [SOLVED]


From: Fabrice Niessen
Subject: Re: [STUMP] Changing keyboard layout... forth and back [SOLVED]
Date: Wed, 14 Jan 2009 10:55:03 +0100
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux)

Hi Bob,

>> Looks almost like the French layout has a different mapping
>> for your prefix key than the English layout. Did you try to
>> use xev to figure out whether that's the case?
>
> I have a top-level bind for switching between layouts:
> (define-key *top-map* (kbd "M-u") "exec setxkbmap gb")
> (define-key *top-map* (kbd "M-f") "exec setxkbmap dvorak")
>
> Since u and f are the same key on the respective layouts, it
> works out nicely.
>
>> P.S. Let me know if it works, I'll setup a multi-language
>> stump pretty soon, too, and might run into the same thing.

Using the idea of top-level bindings, I could further test, and
finally isolated the problem: the mapping of keycode 115 to key
F20 is lost as soon as the layout is changed.

So, updating the previous code that way (adding a call to
`xmodmap' after each `setxkbmap')...

--8<---------------cut here---------------start------------->8---
(defvar *keyboard-layout* :qwerty-gb)
(run-shell-command "setxkbmap gb")

(defcommand toggle-keyboard-layout () ()
  (cond ((eq *keyboard-layout* :qwerty-gb)
         (setf *keyboard-layout* :azerty-fr)
         (message "Keyboard in `azerty-fr'.")
         (run-shell-command "setxkbmap fr && xmodmap -e \'keycode 115 = F20\'"))
        ((eq *keyboard-layout* :azerty-fr)
         (setf *keyboard-layout* :qwerty-gb)
         (message "Keyboard in `qwerty-gb'.")
         (run-shell-command "setxkbmap gb && xmodmap -e \'keycode 115 = 
F20\'"))))

(define-key *root-map* (kbd "F12") "toggle-keyboard-layout")
--8<---------------cut here---------------end--------------->8---

...makes everything works like a charm.

Thank your for the help you all provided...

Best regards,
  Fabrice

___________________________________________
address@hidden
Pre-sales, Network and Software Engineer
M i s s i o n   C r i t i c a l   I T
Phone ... +32 2-757.10.15
Fax ..... +32 2-759.27.60





reply via email to

[Prev in Thread] Current Thread [Next in Thread]