[{"data":1,"prerenderedAt":149},["ShallowReactive",2],{"\u002Fkeyboard-number-symbol-swap":3},{"id":4,"title":5,"body":6,"createdAt":137,"description":12,"draft":138,"extension":139,"image":140,"mastodonThread":140,"meta":141,"navigation":142,"path":143,"seo":144,"stem":145,"tags":146,"updatedAt":147,"__hash__":148},"content\u002FKeyboard Number-Symbol Swap.md","Keyboard_Number-Symbol_Swap",{"type":7,"value":8,"toc":132},"minimark",[9,13,16,19,24,27,30,41,44,47,56,59,65,68,71,77,80,83,89,93,96,118,121],[10,11,12],"p",{},"(Instructions for doing this on other OSes or setups are welcome!)",[10,14,15],{},"The idea here is that we use the symbols at the top of the keyboard a lot more often than the numbers at the top of the keyboard. In my case because I write a lot of perl :)",[10,17,18],{},"Here are the various configurations that you can set to switch the number keys and symbol keys in Linux\u002FX11 -- effectively making it so you don't press shift for the symbols but you DO for the numbers.",[20,21,23],"h2",{"id":22},"configuration","Configuration",[10,25,26],{},"The first, .Xmodmap, is what actually switches things. The others are to make other applications be OK with the new setup.",[10,28,29],{},"From: ~\u002F.Xmodmap",[31,32,37],"pre",{"className":33,"code":35,"language":36},[34],"language-text","! Swap the numbers and symbols\nkeycode  10 = exclam 1\nkeycode  11 = at 2\nkeycode  12 = numbersign 3\nkeycode  13 = dollar 4\nkeycode  14 = percent 5\nkeycode  15 = asciicircum 6\nkeycode  16 = ampersand 7\nkeycode  17 = asterisk 8\nkeycode  18 = parenleft 9\nkeycode  19 = parenright 0\n\n! And the curlies while we're at it\nkeycode  34 = braceleft bracketleft\nkeycode  35 = braceright bracketright\n","text",[38,39,35],"code",{"__ignoreMap":40},"",[10,42,43],{},"Once you put your .Xmodmap in place (and do \"xmodmap .Xmodmap\" to load it), your buttons are swapped! But you might find, as I did, that other applications with key-modifiers expected those same keys to be numbers. Some of them you can just hold down an extra 'shift' for, but some you can't. And that's no fun anyway.",[10,45,46],{},"I did try to do some fancy stuff with xmodmap and then with x11 xkb configuration to make it so that alt+n (no shift) still sent the number key. But I gave up. Suggestions welcome.",[10,48,49,50,55],{},"First thing that I fixed is my ",[51,52,54],"a",{"href":53},"\u002Fxmonad-window-manager","XMonad Window Manager",". It uses alt+n to switch workspaces, so I made it so it can additionally use alt+symbol.",[10,57,58],{},"From: ~\u002F.xmonad\u002Fxmonad.hs",[31,60,63],{"className":61,"code":62,"language":36},[34],"-- This is in my keybinding section\n-- Also switch to spacial workspace for symbol keys\n[((m .|. modm, k), windows $ f i)\n    | (i, k) \u003C- zip myWorkspaces symbolKeys\n    , (f, m) \u003C- [(W.greedyView, 0), (W.shift, shiftMask)]]\n\n-- ... later in the file ...\n-- symbol keys, sorted by order of switching\nsymbolKeys = [ xK_exclam, xK_at, xK_numbersign\n             , xK_dollar, xK_percent, xK_asciicircum\n             , xK_ampersand,  xK_asterisk,  xK_parenleft\n             , xK_parenright]\n",[38,64,62],{"__ignoreMap":40},[10,66,67],{},"Next is screen. It uses ctrl-a, N to switch to the Nth window. ctrl-a, shift-N works, but is no fun. So this will make it so you do ctrl-a, symbol.",[10,69,70],{},"From: ~\u002F.screenrc",[31,72,75],{"className":73,"code":74,"language":36},[34],"# Allow switching using symbols\nbind !  select 1\nbind @  select 2\nbind \\# select 3\nbind $  select 4\nbind %  select 5\nbind \\^ select 6\nbind &  select 7\nbind *  select 8\nbind (  select 9\nbind )  select 0\n",[38,76,74],{"__ignoreMap":40},[10,78,79],{},"Mike does the same thing with Gnome Terminal. He fixed his using the GUI, and it produced this gconf file. You might be able to just drop it in.",[10,81,82],{},"From: ~\u002F.gconf\u002Fapps\u002Fgnome-terminal\u002Fkeybinding\u002F%gconf.xml",[31,84,87],{"className":85,"code":86,"language":36},[34],"\u003C?xml version=\"1.0\"?>\n\u003Cgconf>\n        \u003Centry name=\"switch_to_tab_9\" mtime=\"1300280884\" type=\"string\">\n                \u003Cstringvalue>&lt;Alt&gt;parenleft\u003C\u002Fstringvalue>\n        \u003C\u002Fentry>\n        \u003Centry name=\"switch_to_tab_8\" mtime=\"1300280880\" type=\"string\">\n                \u003Cstringvalue>&lt;Alt&gt;asterisk\u003C\u002Fstringvalue>\n        \u003C\u002Fentry>\n        \u003Centry name=\"switch_to_tab_7\" mtime=\"1300280878\" type=\"string\">\n                \u003Cstringvalue>&lt;Alt&gt;ampersand\u003C\u002Fstringvalue>\n        \u003C\u002Fentry>\n        \u003Centry name=\"switch_to_tab_6\" mtime=\"1300280876\" type=\"string\">\n                \u003Cstringvalue>&lt;Alt&gt;asciicircum\u003C\u002Fstringvalue>\n        \u003C\u002Fentry>\n        \u003Centry name=\"switch_to_tab_5\" mtime=\"1300280873\" type=\"string\">\n                \u003Cstringvalue>&lt;Alt&gt;percent\u003C\u002Fstringvalue>\n        \u003C\u002Fentry>\n        \u003Centry name=\"switch_to_tab_4\" mtime=\"1300280871\" type=\"string\">\n                \u003Cstringvalue>&lt;Alt&gt;dollar\u003C\u002Fstringvalue>\n        \u003C\u002Fentry>\n        \u003Centry name=\"switch_to_tab_3\" mtime=\"1300280867\" type=\"string\">\n                \u003Cstringvalue>&lt;Alt&gt;numbersign\u003C\u002Fstringvalue>\n        \u003C\u002Fentry>\n        \u003Centry name=\"switch_to_tab_2\" mtime=\"1300280865\" type=\"string\">\n                \u003Cstringvalue>&lt;Alt&gt;at\u003C\u002Fstringvalue>\n        \u003C\u002Fentry>\n        \u003Centry name=\"switch_to_tab_10\" mtime=\"1300280859\" type=\"string\">\n                \u003Cstringvalue>&lt;Alt&gt;parenright\u003C\u002Fstringvalue>\n        \u003C\u002Fentry>\n        \u003Centry name=\"switch_to_tab_1\" mtime=\"1300280849\" type=\"string\">\n                \u003Cstringvalue>&lt;Alt&gt;exclam\u003C\u002Fstringvalue>\n        \u003C\u002Fentry>\n\u003C\u002Fgconf>\n",[38,88,86],{"__ignoreMap":40},[20,90,92],{"id":91},"results-of-usage","Results of Usage",[10,94,95],{},"2011.03.18",[97,98,99,103,106,109,112,115],"ul",{},[100,101,102],"li",{},"Entering passwords is tricky",[100,104,105],{},"I find it very difficult to type :) because I type it so often and fast",[100,107,108],{},"Most of the time I find myself still pressing shift when I don't need to",[100,110,111],{},"Less often is not pressing shift when I need numbers",[100,113,114],{},"Vim line-number or count-based operations have become annoying",[100,116,117],{},"Mike noted that \"select count(*)\" is easier to type :)",[10,119,120],{},"2011.10.21",[97,122,123,126,129],{},[100,124,125],{},"I am now also using xbindkeys to make 'shift+shift' (left+right) toggle the setup. That way I can easily switch it back if some other poor fool is trying to use my laptop. On my desktop it isn't a problem since I have the number pad.",[100,127,128],{},"Some number-oriented features line-number are actually easier. For example, in vim when jumping to line 343, I have to press shift to get ':' anyway. so ':343' I hold shift the whole time",[100,130,131],{},"I'm still using this full time, and the main annoying thing is using other people's broken keyboards :)",{"title":40,"searchDepth":133,"depth":133,"links":134},2,[135,136],{"id":22,"depth":133,"text":23},{"id":91,"depth":133,"text":92},"2011-03-18T09:49-04:00",false,"md",null,{},true,"\u002Fkeyboard-number-symbol-swap",{"title":5,"description":12},"Keyboard Number-Symbol Swap",[],"2011-10-21T15:09-04:00","2TXr9So-WqEKnLzO6SbPEK6XlxrTlQisIbXXiMVL5iU",1788139446529]