Affichage des articles dont le libellé est keyboard. Afficher tous les articles
Affichage des articles dont le libellé est keyboard. Afficher tous les articles

samedi 18 mai 2013

Crossing streams : How I swamped my ThinkPad X60s keyboard

I splought (when you choke to avoid coughing but end up spiting twice more with a now open mouth) on my keyboard. Some of it got under the keys. Fortunately I have spare parts, especially keyboards (touchtypist/IBM keyboard feel fetish) so I swap to let this one dry. After a little bit of tissue and a few minutes I plug it back, and I witness something for the first time : a keyboard bug. Pairs of adjacent keys are now influencing each others lines, typing 's' echo 'sa'. '1' echo '21'. 'tab' echo 'tab[invisible caps lock]' which means now it's FREE LISP STYLE. Before I toss it to the garbage I try remove the key support tryptic. It's a set of 3 fragile and tiny plastic parts: a bottom frame, and two crossing hooks forming a X supporting a little rectangle pushing over a latex cushion. I don't know what degree you need to do that, it's all so tiny and weak yet when plugged together its stable and sturdy. Plus it's very very easy to unmount/remount. At least when you figured it out. Anyway, it's amazing, and now that they're all off the keyboard plane, I can spill a little bit of isopropylic alcohol in the hope that it will improve things. It's unbelievably dirty here, full of 0.1mm breadcrumbs, and also lots of cat hair stuck in every possible way...
Time to plug it back for good, just after a quick keyless test (the key are just providing pressure for the board layers to connect, so your finger will do just fine) showing everything got back to order. Reassembling the 10~ keys and their X support is quite fun. And here I am typing this.















reassembly step 1 : pre slide

reassembly step 2 - half slide

reassembly step 3 - pre second half

reassembly step 4 - base seated

step 5 - cross up insertion

step 6 - up insertion done, bottom resting

step 7 - push bottom legs in their plug~

step 8 - legs done








locking claws~ to be clipped on top of Cross

mardi 2 avril 2013

Little elisp proto-snippet of the day : duplicate-line, select-current-line

Because `C-a C-SPC C-e M-w` just doesn't cut it, and I like playing piano, I decided to dig the web for a few helpers. I'm quite fond of the keybindings right now, let's see if they stick.

(defun duplicate-line ()
  "copy the current line underneath"
  (interactive)
  (move-beginning-of-line 1)
  (kill-line)
  (yank)
  (open-line 1)
  (next-line 1)
  (yank)
  (move-beginning-of-line 1)
  (message "TODO: restore caret position?, on original or new line?"))

(defun select-current-line ()
  "Select the current line"
  (interactive)
  ;; (end-of-line) ; move to end of line
  ;; (set-mark (line-beginning-position))

  (beginning-of-line)
  (set-mark (line-end-position))
  (message "TODO: select from begin to end or end to begin ? (caret > [begin..end]/2 => beg to end. end to beg otherwise)"))

(global-set-key (kbd "C-S-d") 'duplicate-line)
(global-set-key (kbd "C-S-l") 'select-current-line)

mardi 8 janvier 2013

Scala value class-like to php macro


;; '//' SPACE CLASS <NAME> '(' ARGS* ')'
;; class name { private args; function name(args) { $this->args = args } public get_args() { return $this->args; }
(fset 'scala-to-php
   [?\C-k ?\C-y ?\C-j ?\C-y ?\C-a tab delete delete delete ?\M-f ?\M-f ?\C-  ?\C-e ?\C-\M-% ?\( ?\\ ?\( ?. ?* ?\\ ?\) ?\) return ?\{ ?\C-q ?\C-j ?\' ?1 backspace backspace ?\\ ?1 ?\C-q ?\C-j ?\} return ?! ?\C-r ?\{ ?\C-e ?\C-f ?\C-  ?\C-e ?\C-\M-% ?, return ?\; ?\C-q ?\C-j return ?! ?\C-e ?\; ?\C-  ?\C-r ?\{ ?\C-e ?\C-f ?\C-\M-% ?^ return ?  ?  ?p ?r ?i ?v ?a ?t ?e ?  ?$ return ?! ?\C-e ?\C-j ?\C-y ?\C-a tab delete delete delete ?\M-d ?f ?u ?n ?c ?t ?i ?o ?n ?\C-e ?  ?\{ ?\} ?\C-a ?\C-s ?\( ?\C-f ?\C-b ?\C-  ?\C-f ?\C-s ?\) ?\C-b ?\C-\M-% ?\\ ?\( ?\[ ?\[ ?: ?a ?s ?c ?i ?i backspace backspace backspace backspace ?l ?p ?h ?a ?\" ?\] ?\] backspace backspace backspace ?: ?\] ?\] ?\\ ?+ backspace backspace ?+ ?\\ ?\) ?\C-b ?\C-e return ?$ ?\' ?1 backspace backspace ?\\ ?1 return ?y ?y ?y ?y ?\C-s ?\{ ?\C-f ?\C-b ?\C-j ?\S-\C-o ?\C-y ?\M-y ?\C-a tab ?\C-s ?\( ?\C-  ?\C-a backspace tab ?\C-e backspace ?\C-a tab ?\C-  ?\C-e ?\C-\M-% ?, return ?\; ?\C-q ?\C-j return ?! ?\C-e ?\; ?\C-r ?\{ ?\C-e ?\C-f ?\C-  ?\C-s ?\} ?\C-p ?\C-e tab ?\C-  ?\C-s ?\C-r ?\{ ?\C-e ?\C-f ?\C-\M-% ?\\ ?\( ?\[ ?\[ ?: ?a ?s ?c ?i backspace backspace backspace ?l ?p ?h ?a ?: ?\] ?\] ?+ ?\\ ?\) ?\; return ?p backspace ?$ ?t ?h ?i ?s ?- ?> ?$ ?\\ ?1 ?  ?= ?  ?$ backspace ?$ ?\\ ?1 ?\; return ?! ?\C-e ?\C-f tab ?\C-e ?\C-j ?\C-y ?\C-a ?\C-  ?\C-s ?\( ?\C-? ?\C-s ?\C-m ?\C-r ?/ ?/ ?\C-f ?\C-a ?\C-  ?\C-s ?\( ?\C-m backspace ?\C-e backspace ?\C-a ?\C-  ?\C-e ?\C-\M-% ?, return ?\C-q ?\C-j return ?! ?\C-r ?\} ?\C-e ?\C-f ?\C-  ?\C-s ?\} ?\C-p ?\C-e ?\C-\M-% ?6 ?\\ ?\( backspace backspace backspace ?^ ?\' backspace ?\\ ?\( ?. ?* ?\\ ?\) return ?p ?u ?b ?l ?i ?c ?  ?g ?e ?t ?_ ?\\ ?1 ?\( ?\) ?\S-  ?\{ ?  ?$ ?t ?h ?i ?s ?- ?\M-b ?r ?e ?t ?u ?r ?n ?  ?\C-e ?. backspace ?> ?$ ?\\ ?1 ?\; ?  ?\} return ?! ?\C-s ?\} ?\C-m ?\C-  ?\C-r ?c ?l ?a ?s ?s ?\C-m tab])

// class User(name,login,password)



===
class User{
  private $name;
  private $login;
  private $password;
  function User($name,$login,$password) {
    $this->$name = $name;
    $this->$login = $login;
    $this->$password = $password;
  }
  public get_name() { return $this->$name; }
  public get_login() { return $this->$login; }
  public get_password() { return $this->$password; }
}

/tmp/kbd-macro.el (END)


I should write an keybindings expander and a literal reducer to make this bearable </lisp>