[Contrib-Patch] XMonad.Actions.KeyRemap

Hi, i had the problem that i wanted to use programmers dvorak keymapping[1] (or better said, i wanted to learn it). But for me as an emacs user it is a little bit disturbing, that my keybindings change when doing so. So i wrote a module that made it possible for me to define a keymapping, so that normal characters are translated by xmonad to programmers dvorak, and everythin that contains a modifier is left untouched. This behaviour is done by grabbing all keys by xmonad and sending appropriate Events to the focused window. It is also possible to change keymaps on the fly. Here i have the empty Mapping (here are also no keys bound by xmonad) on F1 and the dvorak Mapping on F2. greetz didi [1] http://www.kaufmann.no/roland/dvorak/ PS: I hope i got the attachment right, i'm not used to gnus until now. -- No documentation is better than bad documentation -- Das Ausdrucken dieser Mail wird urheberrechtlich verfolgt.

On Sat, May 1, 2010 at 7:42 AM, Christian Dietrich
Hi, i had the problem that i wanted to use programmers dvorak keymapping[1] (or better said, i wanted to learn it). But for me as an emacs user it is a little bit disturbing, that my keybindings change when doing so.
So i wrote a module that made it possible for me to define a keymapping, so that normal characters are translated by xmonad to programmers dvorak, and everythin that contains a modifier is left untouched.
This behaviour is done by grabbing all keys by xmonad and sending appropriate Events to the focused window.
It is also possible to change keymaps on the fly. Here i have the empty Mapping (here are also no keys bound by xmonad) on F1 and the dvorak Mapping on F2.
greetz didi
[1] http://www.kaufmann.no/roland/dvorak/
PS: I hope i got the attachment right, i'm not used to gnus until now.
The attachment is fine, but it'd be better if it were a Darcs patch and not just the raw source. If you're not sure how to 'darcs add' a file, 'darcs record' it as a patch, and then 'darcs send' it to this list, the Darcs manual is useful: http://darcs.net/manual/ -- gwern

The attachment is fine, but it'd be better if it were a Darcs patch and not just the raw source. If you're not sure how to 'darcs add' a file, 'darcs record' it as a patch, and then 'darcs send' it to this list, the Darcs manual is useful: http://darcs.net/manual/
I really want to send a darcs patch file, but code.haskell.org seems to be down for now and i can't figure out how to press a patch out of darcs without code.haskell.org up. greetz didi -- No documentation is better than bad documentation -- Das Ausdrucken dieser Mail wird urheberrechtlich verfolgt.

Hello Christian,
I have a couple suggestions, mostly concerned with documentation:
Type signatures for top level declarations are mandatory.
Blocks of sample code should be prefixed with `>':
-- > foo x y z = ...
-- > ....
Itemized lists need blank lines around each item.
Lastly, the hardcoded constants could be calculated from the strings
you listed with `map (fromIntegral . fromEnum)'. Leave out the
fromIntegral if [Int] is the result you're looking for.
If it was a runtime performance concern, you could use template
haskell to run that calculation at compile time.
Nice idea to restore some unserializable state with the startupHook.
--
Adam
On Sat, May 1, 2010 at 7:42 AM, Christian Dietrich
Hi, i had the problem that i wanted to use programmers dvorak keymapping[1] (or better said, i wanted to learn it). But for me as an emacs user it is a little bit disturbing, that my keybindings change when doing so.
So i wrote a module that made it possible for me to define a keymapping, so that normal characters are translated by xmonad to programmers dvorak, and everythin that contains a modifier is left untouched.
This behaviour is done by grabbing all keys by xmonad and sending appropriate Events to the focused window.
It is also possible to change keymaps on the fly. Here i have the empty Mapping (here are also no keys bound by xmonad) on F1 and the dvorak Mapping on F2.
greetz didi
[1] http://www.kaufmann.no/roland/dvorak/
PS: I hope i got the attachment right, i'm not used to gnus until now.
-- No documentation is better than bad documentation -- Das Ausdrucken dieser Mail wird urheberrechtlich verfolgt.
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

adam vogt
Hello Christian,
I have a couple suggestions, mostly concerned with documentation:
I have done darcs send, but it seems it didn't worked :-( I just fixed the documentation in that patch.
Type signatures for top level declarations are mandatory.
Blocks of sample code should be prefixed with `>':
-- > foo x y z = ... -- > ....
Itemized lists need blank lines around each item.
Lastly, the hardcoded constants could be calculated from the strings you listed with `map (fromIntegral . fromEnum)'. Leave out the fromIntegral if [Int] is the result you're looking for.
let a = (map fromEnum "abc") :: [KeySym] <interactive>:1:13: Couldn't match expected type `KeySym' against inferred type `Int' In the first argument of `map', namely `fromEnum' In the expression: (map fromEnum "abc") :: [KeySym] In the definition of `a': a = (map fromEnum "abc") :: [KeySym] If you can give me a way around this type issue i will fix it with pleasure.
If it was a runtime performance concern, you could use template haskell to run that calculation at compile time.
No, i just was a type quirck, i couldn't get around I Just attached the patch. I hope it is the right format, i couldn't figure out how to get a patch out of this darcs without darcs send. greetz didi -- No documentation is better than bad documentation -- Das Ausdrucken dieser Mail wird urheberrechtlich verfolgt.

* On Sunday, May 02 2010, Christian Dietrich wrote:
adam vogt
writes: Lastly, the hardcoded constants could be calculated from the strings you listed with `map (fromIntegral . fromEnum)'. Leave out the fromIntegral if [Int] is the result you're looking for.
let a = (map fromEnum "abc") :: [KeySym]
<interactive>:1:13: Couldn't match expected type `KeySym' against inferred type `Int' In the first argument of `map', namely `fromEnum' In the expression: (map fromEnum "abc") :: [KeySym] In the definition of `a': a = (map fromEnum "abc") :: [KeySym]
If you can give me a way around this type issue i will fix it with pleasure.
Prelude XMonad> map (fromIntegral . fromEnum) "qwerty" :: [KeySym] [113,119,101,114,116,121] -- Adam

Adam Vogt
Prelude XMonad> map (fromIntegral . fromEnum) "qwerty" :: [KeySym] [113,119,101,114,116,121]
Thank you very much, i replaced this and attached the new patch greetz didi -- No documentation is better than bad documentation -- Das Ausdrucken dieser Mail wird urheberrechtlich verfolgt.

* On Sunday, May 02 2010, Christian Dietrich wrote:
Adam Vogt
writes: Prelude XMonad> map (fromIntegral . fromEnum) "qwerty" :: [KeySym] [113,119,101,114,116,121]
Thank you very much, i replaced this and attached the new patch
greetz didi -- No documentation is better than bad documentation -- Das Ausdrucken dieser Mail wird urheberrechtlich verfolgt.
Hello Christian, One final thing prevents me from applying your patch: darcs won't apply your patch: the context lines after the body of the patch (make it with `darcs send -O') seem to be necessary. Thanks, Adam

Adam Vogt
Hello Christian,
One final thing prevents me from applying your patch:
darcs won't apply your patch: the context lines after the body of the patch (make it with `darcs send -O') seem to be necessary.
Thanks, Adam
hm, code.haskell.org seems to be down quite often at the moment, perhaps it is possible for you to pull from [1]. greetz didi [1] http://dokucode.de/files/XMonadContrib/ -- No documentation is better than bad documentation -- Das Ausdrucken dieser Mail wird urheberrechtlich verfolgt.

On Mon, May 3, 2010 at 4:45 AM, Christian Dietrich
hm, code.haskell.org seems to be down quite often at the moment, perhaps it is possible for you to pull from [1].
greetz didi
I've applied your KeyRemap patch. Thanks.
participants (4)
-
adam vogt
-
Adam Vogt
-
Christian Dietrich
-
Gwern Branwen