2013-06-01

Linux, emacs: Symbols for Super, Hyper keys

Linux. Here's a proposal of a logo/symbol for the Super and Hyper key:

  • Super Key (BLACK DIAMOND MINUS WHITE X, 10070, x2756)
  • Hyper Key (WHITE FOUR POINTED STAR, 10023, x2727)

For Ctrl, Opt, Alt, etc, see: Unicode: Keyboard Symbols, UI Icons ↹ ⌫ ⌘ ✉ ✍ ⌖

2013-05-31

AutoScroll on Linux Google Chrome Browser

another mousing tip. For those of you on Linux, using Chrome, there's no mouse wheel scroll acceleration. Worse, there's no autoscroll. That is, you can't middle click on a area and move mouse to pan the page.

Solution: install a AutoScroll extension. There's quite a number of them. But the first one i tried, and works fine, is this one: https://chrome.google.com/webstore/detail/autoscroll/occjjkgifpmdgodlplnacmkejpdionan

Or, you can buy a Logitech mouse sporting Hyperscroll, that is, the wheel spins. Logitech Gaming Mouses Review or Logitech Mouse with Spin Wheel. (i recommend the gaming ones, because for the same money, they are better, more buttons.)

the myth qwerty dvorak keyboard layout

there's a myth of myth about Dvorak layout being not much efficient than QWERTY.

it's strange. Typically, they are made by people who never touch type any of the alternate layouts, OR, from a new layout creator selling his layout.

It typically goes like this:

Contrary to popular belief, the QWERTY layout was not designed to slow the typist down, but rather to speed up typing by preventing jams.

—Wikipedia article on QWERTY as of at 〔QWERTY〕, citing from a passage on Maltron's website, which sells the Maltron layout. This: http://www.maltron.com/keyboard-info/technical-keyboard-information/academic-papers/236-lillian-malt-papers.html

Here's another one, from the famous design critic, Donald Norman. Quote:

Wrong. Crowley and Cohen perpetuate the false belief that qwerty was intended to slow typing. In fact, it is one of the fastest keyboards around. There's not enough space here to explain fully. But I have done experiments on and published a lot about this. Qwerty was designed to prevent jamming of keys back in the days when everything was mechanical a …

from 〔Is the QWERTY keyboard layout the most efficient one? Or are there better ones? By Don Norman. @ www.quora.com…

I hope i'm not taking it out of context.

Here's another, recent one, from the blog of the famed Smithsonian Institution.

While it can't be argued that deal with Remington helped popularize the QWERTY system, its development as a response to mechanical error, has been questioned by Kyoto University Researchers Koichi Yasuoka and Motoko Yasuoka. In a 2011 paper, the researchers tracked the evolution of the typewriter keyboard alongside a record of its early professional users. They conclude that the mechanics of the typewriter did not influence the keyboard design. Rather, the QWERTY system emerged as a result of how the first typewriters were being used. Early adopters and beta-testers included telegraph operators who needed to quickly transcribe messages. However, the operators found the alphabetical arrangement to be confusing and inefficient for translating morse code. The Kyoto paper suggests that the typewriter keyboard evolved over several years as a direct result of input provided by these telegraph operators. …

— from 〔Fact of Fiction? The Legend of the QWERTY Keyboard By Jimmy Stamp. @ blogs.smithsonianmag.com…local copy

Ok, they are now debunking that QWERTY wasn't even about preventing jams, but came from telegraph machines. But, here comes the damnation, out of the blue:

More recent research has debunked any claims that Dvorak is more efficient, …

On the phrase “recent research”, they linked to a slashdot news post: 〔Dvorak Layout Claimed Not Superior To QWERTY @ hardware.slashdot.org…

The Slashdot post regurgitates the granddaddy about Dvorak not being efficient than QWERTY: 〔Typing Errors: The standard typewriter keyboard is Exhibit A in the hottest new case against markets. But the evidence has been cooked By Stan Liebowitz & Stephen E Margolis. @ reason.com…

Now, comes the payload. The Smithsonian article introduces us a new layout, called KALQ layout. Quote:

KALQ keyboard layout
The KALQ keyboard layout (image: Outlasvirta et al.)

When a design depends on a previous innovation too entrenched in the cultural zeitgeist to change, it’s known as a path dependency. And this why the new KALQ proposal is so interesting. …

Is that a sponsored article? They didn't say.

The Myth of Myth of Dvorak

full article at http://xahlee.info/kbd/myth_of_qwerty_dvorak_layout.html

2013-05-29

Linux: gnome, xfce, where is trash location

Perm URL with updates: http://xahlee.info/linux/linux_trash_location.html

What's the Linux command to put things in trash?

You can do gvfs-trash ‹filepath›.

Where is the trash folder?

Example trash location:

  • 〔~/.local/share/Trash/〕 → on your local file system.
  • 〔/media/PENDRIVE/.Trash-1000/〕 → on a USB drive.
  • 〔/root/.local/share/Trash/〕 → if you are root, on your local file system.

How does Linux Trash Work?

In the trash dir, there are 3 dirs:

  • 〔expunged〕→ (this is not in spec.)
  • 〔files〕 → contains the actual trashed files.
  • 〔info〕 → contains text file that has info about trashed file.

For example, if you have a file at 〔/home/jane/Downloads/cat.jpg〕 and you deleted to trash. Then, you'll have:

  • 〔~/.local/share/Trash/files/cat.jpg〕
  • 〔~/.local/share/Trash/info/cat.jpg.trashinfo〕

and the file 〔cat.jpg.trashinfo〕 will have content like this:

[Trash Info]
Path=/home/jane/Downloads/cat.jpg
DeletionDate=2013-05-29T00:09:26

You can delete the trash dir. ⁖ rm -rf ~/.local/share/Trash/.

Reference. 〔The FreeDesktop.org Trash specification @ www.ramendik.ru…

GUI vs Command Line — a Unified Design

Perm URL with updates: http://xahlee.info/comp/gui_vs_command_line_unified_scheme.html

Problems of Graphics User Interface

GUI is great, especially for new users. Though, there are many problems with GUI. Example:

Instruction on using it becomes elaborate and imprecise. Also, the GUI changes overtime (just consider how to turn off cookies in web browser), so instruction becomes ineffective. When in a programing environment, GUI apps can't be precisely controlled, as API.

For example, try to tell a newbie how to change mouse settings. It goes like this: go to the menu at lower left, then you should see a Control Panel menu somewhere, open it, click on upper right to list all items, then you should see a the one with mouse icon, double click it, then there should be a tab named xyz, in there, left panel, there's a sub tab, click that, then there's a slider….

Problems of Command Line Interface

Command line is great, efficient, precise, but it suffers for many inherent problems in textual interface. Typically, it's incomprehensible, even if a well designed one. You really have to be a programer and read most of its manuals and have significant experience with it to be able to use it. (⁖ consider unix's shell commands) Even then, many things it just falls short. For example: in GUI, you can list things, and scroll, or see CPU usage graphs. The use of infographic or other visual elements are a order of magnitude beyond what command line tools can offer. (best example is trying to understand statistical data, by numbers, or by a graph.)

For example, let's say the Linux package system dpkg or apt-get. 〔☛ Linux: Package System {dpkg, apt-get} Notes〕 With command line, you are completely lost on what to do. You need to read a tutorial first. But if you use a GUI such as Synaptic, you don't need to spend a few hours to study it. You can use it fruitfully right away. When you consider the millions of software out there, it's clear that graphical interface are a order of magnitude superior in general.

A Unified Solution

So, i just came up with one unified grand scheme of user interface design.

Here's a very quick sketch. To resolve this, the GUI tool, will basically be like Microsoft Windows 95's GUI system, of windows menu plus Alt key mechanism. Every command is tied to a sequence of key press, starting with a key such as Alt. Also, EVERY command correspond to a menu item. Also, the key sequence will be unique, and NEVER change. This way, the key sequence serves as a ID for the command

So, we have 3 set of things: {① commands, ② key sequence, ③ Menu}. And there's a one-to-one map between them (or, something similar. One-to-one map between all three may be too strong. We might just require a one-to-one map between key and menu, and these will map to command space, like a function.)

And, when Alt is pressed, the menu should be invoked visually, unless the complete key sequence is pressed very fast, in that case the key sequence function as keyboard shortcut.

This is a quick sketch of the idea. Will have to expand on this later.

todo:

  • what happens with command line options?
  • how this sync with say touch based GUI and voice interface? (or, does it make sense to sync, the nature of interface, …)

ErgoEmacs Terminal Arrow Fix

Matthew L Fidler fixed a long-standing major bug in ErgoEmacs keybinding. See: https://code.google.com/p/ergoemacs/issues/detail?id=37

In terminal, when you press arrow keys, ErgoEmacs will insert gibberish. This is a semi-bug in emacs.

In emacs, put this in your init:

(global-set-key (kbd "M-O") 'forward-char)

nothing but just that line. Then, start emacs by emacs -nw. Then press any arrow key, you'll see that it insert gibberish.

This is related to escape sequence in terminal. Kinda have to do with terminal history. The arrow keys actually send escape sequences, and somehow, so does emacs's 【Meta+O】. (this is why emacs's Meta can also be pressed by Esc)

From user's perspective, this is clearly a emacs bug, but it might be such historical issue that it's hard to fix or can't be fixed. A related issue is that in emacs running in terminal, it can't distinguish between 【Ctrl+A】 and 【Ctrl+a】.

2013-05-28

How to Stop Xfce from Loading Last Session

in the control panel, you can set whether to load last session when computer starts. There's a app named “Sessions and Startup”. However, it doesn't work well. I can't find a place where it says to stop loading last session. Then, in the Logout popup, there's a checkbox, but if you uncheck, it still loads old session.

Here's how you can clean the session.

run this:

rm -rf ~/.cache/sessions/

Then restart. sudo shutdown -r 0.

2013-05-27

laser mouse is inferior to optical mouse!

Perm URL with updates: http://xahlee.info/kbd/mouse_optical_vs_laser.html

Both optical and laser mouse use light technology.

  • Optical mouse uses LED, while laser uses laser.
  • Optical is earlier tech, laser is more “advanced” tech.
  • Optical mouse has a big red light at bottom. Laser ones are invisible.
  • Laser tech can track on more surfaces, such as on glass, and with higher frequency.
  • Laser mouse jitters when you lift the mouse, optical doesn't.

For gamers, laser mouse may actually be worse.

Here's a simple test you can do.

Lift your mouse slowly up, but try not to move the mouse.

  • If you are using a laser mouse, you'll see that the pointer jitters.
  • If you are using a optical LED mouse, the pointer does not move.

A even more spectacular test is just to pick up your mouse and stick your finger in the laser hole. You'll see your pointer jitters randomly, yet your finger is absolutely still.

See also:

color model conversion in emacs lisp

For emacs lisp coders, there's a newish color package 〔color.el〕, bundled with emacs 24.3 at least.

the package lets you convert colors from various models and formats. ⁖ RGB, HSL, HSV, named color values, and things like finding the color complement.

call describe-function on color-rgb-to-hex and you'll have a link to it.

it's written by Julien Danjou, Drew Adams. Superb. Thanks guys.

For more info and sample code, see: http://ergoemacs.org/emacs/elisp_convert_rgb_hsl_color.html

2013-05-26

emacs tip: save cursor position across sessions

Perm URL with updates: http://ergoemacs.org/emacs/emacs_save_cursor_position.html

You can save the cursor position for every file you opened. So, next time you open the file, the cursor will be at the position you last opened it.

Put this code in your emacs init file:

;; turn on save place so that when opening a file, the cursor will be at the last position.
(require 'saveplace)
(setq save-place-file (concat user-emacs-directory "saveplace.el") ) ; use standard emacs dir
(setq-default save-place t)

This mode is ancient, from 1993. 〔saveplace.el〕 is written by Karl Fogel, who is active on emacs dev mailing list as of . Karl is also famous as the one who wrote one of the first open source book (if i recall correctly, it became the offical cvs documentation for many years). Karl is also the author of Emacs's Bookmark Feature. Thanks Karl.

logitech mouse free-spin scroll wheel

Perm URL with updates: http://xahlee.info/kbd/mouse_with_spinning_flywheel.html

Logitech came up with mouse wheel that spins freely.

Logitech G9 mouse wheel
Logitech mouse spin wheel

Its wheel has 2 modes. Notched vs Free-spin. There's a button below the wheel that lets you toggle the mode.

In spin mode, it will keep spinning. (if you push it hard, it can maintain spinning for 28 seconds!) This is very useful for scrolling long pages.

Logitech MX1100 mouse wheel spinning.
logitech anywhere mouse mx-s
“Logitech Anywhere Mouse MX” amazon 1500×1500
logitech mouse mx-s
“Logitech Performance Mouse MX” 1500×1500 amazon

Most models of their gaming mouse also has flywheel feature. See: Logitech Gaming Mouses Review.

If you are buying them, i recommend their gaming model, because, for the same price, the gaming models are often more feature rich, because the market customers there are more tech savvy.

10'000 RPM Mouse wheel spin - Logitech Performance MX

Why Spinwheel is Good?

Spinning is extremely useful when you don't have accelerated scroll.

If you have accelerated scroll, you can scroll a long page by just a few fast flicks. And you can comfortably control the rate to stop at any position of the page.

If you don't have accelerated scroll. You have to push the wheel some 30 times, or move hand to keyboard and use ⇞ Page △ ⇟ Page ▽ keys. Using page keys jump by screenful, then you have to use arrow keys to position it, or back to scroll wheel.

(long pages are common. Most social network sites, g+, Facebook, twitter, by default has long pages, and when you hit bottom it expands, aka infinite scroll.)

Which OS Have System-Wide Accelerated Scroll?

  • On Microsoft Windows, if you buy a Microsoft mouse, it has accelerated scroll.
  • On Mac, it has accelerated scroll by default.
  • On Linux, no system-wide accelerated scroll.

So, if you are on Linux, then the free-spin wheel becomes very useful.

Linux: No Accelerated Scroll and No Autoscroll!

On Linux, there's no system-wide mouse wheel acceleration. It's app-dependent, and very few apps implements that.

Worse, in Firefox or Google Chrome, there's no “autoscroll” feature. Without accelerated scroll, you can work around with autoscroll. That is, press middle button, then move mouse to pan-scroll. The rate is dependent on your mouse position. You can turn this on in Firefox, but not in Google Chrome.

See: Firefox: Set Mouse Wheel Scroll Speed, Backspace for Previous Page, Autoscroll

why you need a 9 buttons mouse

Perm URL with updates: http://xahlee.info/kbd/why_you_need_a_9_buttons_mouse.html

Basic mouse today has 3 buttons: left, middle (wheel), right. Many mouses today have 5 buttons, by adding 2 extra buttons for the thumb. Usually for browser forward/backward.

But many gaming mouses sports 9 or more buttons. Why do you need it?

  • 3 standard left/middle/right buttons.
  • 2 buttons for browser back/forward.
  • 2 buttons for prev/next tab. This is incredibly useful.
  • 1 button for closing tab (【Ctrl+w】). Again, extremely useful.

That's 8 buttons already. To be luxurious, you'll also want:

  • 2 button to switch window or workspace.
  • 1 button to close window. (【Alt+F4】)

Then, there's desire. You desire:

  • Side scroll wheel is useful. Saves you from scrolling side-to-side that's sometimes handy. Mouse makes count them as 2 buttons.
  • Logitech's flywheel. This is actually critical in Linux, because X11 doesn't support accelerated scroll. Usually, there's a button to toggle this.
  • Resolution switch. Usually, there are 2 buttons for this. This is quite important in some games. For example, in military combat games, when you snipe someone far away, reducing resolution helps aiming greatly. See picture here: Xah Combat Aim Radar.

Counting the Buttons: Practical vs Technical

Usually, mouse makers count all things that sends a signal. For example, they count 2 buttons for increase/decrease DPI resolution as programable buttons, and count mouse wheel left/right push as 2 more buttons. And, the standard left/middle/right are also counted as 3 buttons.

That's not a good way to count buttons if you are shopping, because, such buttons have default actions that you wouldn't want to change.

You should count only buttons that can be practically used for your customization.

Best Multi-Button Mouse

The best multi-buttons mouse is this:

Logitech G700s mouse
“Logitech G700s Rechargeable Gaming Mouse” amazon

Practically 7 extra buttons. Flywheel. Wireless, but rechargeable.

Second best is:

Logitech G600 mouse
“Logitech G600 MMO Gaming Mouse” amazon

12 buttons on the side, like a keypad, but sculpted, so you can easily feel the right button. Wired. No flywheel.

Logitech G600 VS. Razer Naga - MMO Mouse Face-off

See: Logitech Gaming Mouses Review

Logitech G300 mouse. (review for programer)

Perm URL with updates: http://xahlee.info/kbd/logitech_g300_gaming_mouse.html

logitech g300 mouse 3-s logitech g300 mouse 1-s logitech g300 mouse 2-s
“Logitech G300 Gaming Mouse” amazon 1332×1392 1232×460 1168×660

Features:

  • Wired
  • Symmetric shape.
  • Optical. (not laser)
  • 9 programable buttons. 6 are practically customizable. (the left/middle/right standard ones doesn't count.)
  • On-board memory. (3 profiles for storage of settings)
  • Mouse lights up! Color changes depending on current profile!
  • Instant sensitivity (DPI) change.

This mouse is on the small side, good for people with small hands.

See also:

Logitech G300 Gaming Mouse Review

On Linux, you need to run this script to get it to work.

#!/bin/sh
G300_XINPUT_ID=$(xinput list | egrep --color=never "G300.*keyboard" | sed -r 's/.*id=([0-9]+).*/\1/')
xinput set-mode ${G300_XINPUT_ID} RELATIVE

references: