<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cyher.NET &#187; linux</title>
	<atom:link href="http://cyher.net/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://cyher.net</link>
	<description>Technology, Life, Code, OpenSource, *nix, Mac and iphone, Mobile development</description>
	<lastBuildDate>Sun, 25 Jul 2010 08:43:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Android 手机电源管理实例 &#8211; milestone</title>
		<link>http://cyher.net/gnulinux/android/android-phone-powermanagement</link>
		<comments>http://cyher.net/gnulinux/android/android-phone-powermanagement#comments</comments>
		<pubDate>Sun, 25 Jul 2010 08:07:59 +0000</pubDate>
		<dc:creator>cyher</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[milestone]]></category>
		<category><![CDATA[power management]]></category>

		<guid isPermaLink="false">http://cyher.net/?p=637064</guid>
		<description><![CDATA[
	标签：android, linux, milestone, power management

	相关日志
	
	android驱动之虚拟按键 (0)
	android驱动之jogball (2)
	自己的嵌入式学习经验, 想不到别人给拍成视频了 (0)
	自己曾经作过的小实验 (0)
	科技是一种信仰(apple&#038;linux) (5)


]]></description>
			<content:encoded><![CDATA[
<table id="wp-table-reloaded-id-1-no-1" class="wp-table-reloaded wp-table-reloaded-id-1">
<thead>
	<tr class="row-1 odd">
		<th class="column-1"></th><th class="column-2">MOTO Milestone (omap)</th><th class="column-3">HTC tattoo (msm7225)</th><th class="column-4">HTC Magic (msm7201A)</th><th class="column-5">某手机(保密)(msm7227)</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">开机过程</td><td class="column-2">200ma-1000ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5">200ma-500ma</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">HSDPA 联网</td><td class="column-2">700ma</td><td class="column-3"></td><td class="column-4">500ma</td><td class="column-5"></td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">idle, 屏幕最暗, 黑色背景,键灯关</td><td class="column-2">44ma</td><td class="column-3">13ma</td><td class="column-4">33ma</td><td class="column-5">60ma</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">idle, 屏幕中等, 黑色背景,键灯关</td><td class="column-2">69ma</td><td class="column-3">64ma</td><td class="column-4">73ma</td><td class="column-5">88ma</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">idle, 屏幕最亮, 黑色背景,键灯关</td><td class="column-2">104ma</td><td class="column-3">97ma</td><td class="column-4">135ma</td><td class="column-5">120ma</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">idle, 屏幕最暗, 动态桌面,键灯关</td><td class="column-2">330ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">idle, 屏幕中等, 动态桌面,键灯关</td><td class="column-2">350ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">idle, 屏幕最亮, 动态桌面,键灯关</td><td class="column-2">450ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">idle, 屏幕最暗, 白背景,键灯关</td><td class="column-2">51ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">idle, 屏幕中等, 白背景,键灯关</td><td class="column-2">92ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">idle, 屏幕最亮, 白背景,键灯关</td><td class="column-2">167ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">照相机预览</td><td class="column-2">400ma-500ma(1G)<br />
325ma-350ma(550M)</td><td class="column-3">210ma-260ma</td><td class="column-4">295ma-334ma</td><td class="column-5"></td>
	</tr>
	<tr class="row-14 even">
		<td class="column-1">录制音频(开屏)</td><td class="column-2">107ma-112ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-15 odd">
		<td class="column-1">录制音频(关屏)</td><td class="column-2">43ma-59ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-16 even">
		<td class="column-1">录制视频</td><td class="column-2">500ma-700ma(1G)<br />
427ma-558ma(550M)</td><td class="column-3">260ma-360ma</td><td class="column-4">360ma-390ma</td><td class="column-5"></td>
	</tr>
	<tr class="row-17 odd">
		<td class="column-1">google maps(gps开)</td><td class="column-2">540ma-750ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-18 even">
		<td class="column-1">浏览网页(HSDPA)(有数据链接时)</td><td class="column-2">400ma-600ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-19 odd">
		<td class="column-1">浏览网页(EDGE)(有数据链接时)</td><td class="column-2">200ma-500ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-20 even">
		<td class="column-1">开屏,放mp3,耳机</td><td class="column-2">90ma-120ma</td><td class="column-3"></td><td class="column-4">168ma-220ma</td><td class="column-5">285ma</td>
	</tr>
	<tr class="row-21 odd">
		<td class="column-1">关屏, 放mp3,耳机</td><td class="column-2">30ma-50ma</td><td class="column-3"></td><td class="column-4">93ma-112ma</td><td class="column-5">210ma</td>
	</tr>
	<tr class="row-22 even">
		<td class="column-1">开屏, 放mp4,耳机(放自己拍摄的)</td><td class="column-2">250ma-300ma</td><td class="column-3"></td><td class="column-4">300ma-327ma</td><td class="column-5"></td>
	</tr>
	<tr class="row-23 odd">
		<td class="column-1">开启g-sensro和gps</td><td class="column-2">320ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-24 even">
		<td class="column-1">wifi扫描时</td><td class="column-2">150ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-25 odd">
		<td class="column-1">开led闪光灯(长亮)</td><td class="column-2">50ma(单独计算)</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-26 even">
		<td class="column-1">虚拟按键led</td><td class="column-2">20ma(单独计算)</td><td class="column-3">14ma</td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-27 odd">
		<td class="column-1">GSM通话(开接近)</td><td class="column-2">350ma-450ma</td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-28 even">
		<td class="column-1">suspend(关屏进入休眠)</td><td class="column-2">2ma</td><td class="column-3">1ma</td><td class="column-4">1ma</td><td class="column-5">2ma</td>
	</tr>
</tbody>
</table>


	标签：<a href="http://cyher.net/tag/android" title="android" rel="tag">android</a>, <a href="http://cyher.net/tag/linux" title="linux" rel="tag">linux</a>, <a href="http://cyher.net/tag/milestone" title="milestone" rel="tag">milestone</a>, <a href="http://cyher.net/tag/power-management" title="power management" rel="tag">power management</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://cyher.net/gnulinux/android/virualkey" title="android驱动之虚拟按键 (2010年03月22号)">android驱动之虚拟按键</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/android/android-driver-jogball" title="android驱动之jogball (2010年03月16号)">android驱动之jogball</a> (2)</li>
	<li><a href="http://cyher.net/gnulinux/%e5%ad%a6%e4%b9%a0%e7%bb%8f%e9%aa%8c" title="自己的嵌入式学习经验, 想不到别人给拍成视频了 (2009年08月9号)">自己的嵌入式学习经验, 想不到别人给拍成视频了</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/%e8%87%aa%e5%b7%b1%e6%9b%be%e7%bb%8f%e4%bd%9c%e8%bf%87%e7%9a%84%e5%b0%8f%e5%ae%9e%e9%aa%8c" title="自己曾经作过的小实验 (2009年08月16号)">自己曾经作过的小实验</a> (0)</li>
	<li><a href="http://cyher.net/apple/macos-x/technology_is_a_kind_of_belief_appl" title="科技是一种信仰(apple&#038;linux) (2009年01月12号)">科技是一种信仰(apple&#038;linux)</a> (5)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://cyher.net/gnulinux/android/android-phone-powermanagement/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>macbook pro ubuntu10.4 bcm无线网卡问题修复</title>
		<link>http://cyher.net/gnulinux/macbook-pro-ubuntu10-4-bcm-wireless-driver</link>
		<comments>http://cyher.net/gnulinux/macbook-pro-ubuntu10-4-bcm-wireless-driver#comments</comments>
		<pubDate>Sun, 02 May 2010 13:03:00 +0000</pubDate>
		<dc:creator>cyher</dc:creator>
				<category><![CDATA[GNU/linux]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://cyher.net/?p=637057</guid>
		<description><![CDATA[话说虽然用了macbook pro成了apple fan但是也没有使我对linux的热情衰减， 这不刚刚把macbook pro上的9.10升级为10.4， 这回我相信ubuntu的自动升级能力，但是结果是，我不应该像要求mac os x一样要求 ubuntu。 有几个东西不能用了，但是那也无关紧要，最要命的使我的wireless的驱动没了，装不上了，靠。这个我受不了。找到了以下解决方法。
首先，说明一点，我的电脑是macbook pro 471，就是macbook pro 5,1.
本来是应该这样解决的
System-&#62;Administration-&#62;Hardware Drivers. Select the Broadcom STA options and click enable.
但是现在不行了。
1. 下载broadcom驱动源码，http://www.broadcom.com/support/802.11/linux_sta.php
2. 解压，然后找到 src/wl/sys/wl_linux.c 这个文件
3. 在 #include &#60;XX.h&#62;的下面一行加上下面的代码
#include &#60;﻿linux/sched.h&#62;
4. 编译源码  make
5.把新编译的driver放到lib中
sudo mv wl.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless
6. 更新依赖关系
sudo depmod -a
7. ok 加入内核
modprobe wl
8. 如果编译报 没有include &#60;linux/sched.h&#62; 加入新的内核头文件。
sudo apt-get install linux-headers-$(uname -r)
到这里基本上就ok了 可以继续自由自在了，至于以后升级内核从新来一遍就ok

	标签：driver, linux, macbook, ubuntu, [...]]]></description>
			<content:encoded><![CDATA[<p>话说虽然用了macbook pro成了apple fan但是也没有使我对linux的热情衰减， 这不刚刚把macbook pro上的9.10升级为10.4， 这回我相信ubuntu的自动升级能力，但是结果是，我不应该像要求mac os x一样要求 ubuntu。 有几个东西不能用了，但是那也无关紧要，最要命的使我的wireless的驱动没了，装不上了，靠。这个我受不了。找到了以下解决方法。</p>
<p>首先，说明一点，我的电脑是macbook pro 471，就是macbook pro 5,1.</p>
<p>本来是应该这样<a href="https://help.ubuntu.com/community/MacBookPro5-1_5-2/Lucid#Wireless">解决</a>的</p>
<blockquote><p>System-&gt;Administration-&gt;Hardware Drivers. Select the Broadcom STA options and click enable.</p></blockquote>
<p>但是现在不行了。</p>
<p>1. 下载broadcom驱动源码，<a href="http://www.broadcom.com/support/802.11/linux_sta.php" target="_blank">http://www.broadcom.com/support/802.11/linux_sta.php</a></p>
<p>2. 解压，然后找到 src/wl/sys/wl_linux.c 这个文件</p>
<p>3. 在 #include &lt;XX.h&gt;的下面一行加上下面的代码</p>
<p><code>#include &lt;﻿linux/sched.h&gt;</code></p>
<p>4. 编译源码  make</p>
<p>5.把新编译的driver放到lib中</p>
<p><code>sudo mv wl.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless</code></p>
<p>6. 更新依赖关系</p>
<p><code>sudo depmod -a</code></p>
<p>7. ok 加入内核<br />
modprobe wl<br />
8. 如果编译报 没有include &lt;linux/sched.h&gt; 加入新的内核头文件。</p>
<p><code>sudo apt-get install linux-headers-$(uname -r)</code></p>
<p>到这里基本上就ok了 可以继续自由自在了，至于以后升级内核从新来一遍就ok</p>

	标签：<a href="http://cyher.net/tag/driver" title="driver" rel="tag">driver</a>, <a href="http://cyher.net/tag/linux" title="linux" rel="tag">linux</a>, <a href="http://cyher.net/tag/macbook" title="macbook" rel="tag">macbook</a>, <a href="http://cyher.net/tag/ubuntu" title="ubuntu" rel="tag">ubuntu</a>, <a href="http://cyher.net/tag/wireless" title="wireless" rel="tag">wireless</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://cyher.net/apple/multi-os-on-macbook" title="在macbook上安装各种操作系统 (2009年07月26号)">在macbook上安装各种操作系统</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/bad_cheese_linux" title="变质的奶酪,linux! (2009年01月18号)">变质的奶酪,linux!</a> (2)</li>
	<li><a href="http://cyher.net/gnulinux/android/virualkey" title="android驱动之虚拟按键 (2010年03月22号)">android驱动之虚拟按键</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/android/android-driver-jogball" title="android驱动之jogball (2010年03月16号)">android驱动之jogball</a> (2)</li>
	<li><a href="http://cyher.net/gnulinux/%e5%ad%a6%e4%b9%a0%e7%bb%8f%e9%aa%8c" title="自己的嵌入式学习经验, 想不到别人给拍成视频了 (2009年08月9号)">自己的嵌入式学习经验, 想不到别人给拍成视频了</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://cyher.net/gnulinux/macbook-pro-ubuntu10-4-bcm-wireless-driver/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>android驱动之虚拟按键</title>
		<link>http://cyher.net/gnulinux/android/virualkey</link>
		<comments>http://cyher.net/gnulinux/android/virualkey#comments</comments>
		<pubDate>Mon, 22 Mar 2010 03:09:57 +0000</pubDate>
		<dc:creator>cyher</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[virualkey]]></category>

		<guid isPermaLink="false">http://cyher.net/?p=637050</guid>
		<description><![CDATA[1    背景
nexus one工业设计简洁，类似于iphone只有一个按键的设计，只有中间的一个轨迹球。但是android标准键盘是有 HOME，MENU，BACK，SEARCH等，但是同时要保持工业设计。nexus one是这样解决问题的，显示屏是800X480，但是在电容触摸屏是8xx*480的就是比800要大的地方就变成了虚拟按键，模拟了android标准按键。
2    方案
要实现，虚拟按键，在android里面是靠两层协助实现，底层要把虚拟按键在比显示屏多出的地方规定好虚拟按键的位置大小以及键值等，给上层一文件接口。上层java层启动一个服务来读取这一区域的按键响应，这样就是大体的架构。具体实现如下：
2.1    底层虚拟按键功能实现方案
简而言之，就是在内核中把虚拟按键的所有信息给上层给出，用什么方式？就是用sys文件系统的方式，sys文件系统的路径是约定好的所以代码如下实现。给出信息的协议格式是一段连续的字符串，每个按键有六项分别用冒号分割，按键按键之间也是用冒号分割，六项按顺序分别是：
键类型:键值:按键区域中心x坐标:按键区域中心y坐标:按键区域宽:按键区域高
arch/arm/mach-msm/board-mahimahi.c

static ssize_t mahimahi_virtual_keys_show&#40;struct kobject *kobj,
			       struct kobj_attribute *attr, char *buf&#41;
&#123;
	if &#40;system_rev &#38;gt; 2&#41; &#123;
		/* center: x: back: 55, menu: 172, home: 298, search 412, y: 835 */
		return sprintf&#40;buf,
			__stringify&#40;EV_KEY&#41; &#34;:&#34; __stringify&#40;KEY_BACK&#41;  &#34;:55:835:90:55&#34;
		   &#34;:&#34; __stringify&#40;EV_KEY&#41; &#34;:&#34; __stringify&#40;KEY_MENU&#41;   &#34;:172:835:125:55&#34;
		   [...]]]></description>
			<content:encoded><![CDATA[<h1>1    背景</h1>
<p>nexus one工业设计简洁，类似于iphone只有一个按键的设计，只有中间的一个轨迹球。但是android标准键盘是有 HOME，MENU，BACK，SEARCH等，但是同时要保持工业设计。nexus one是这样解决问题的，显示屏是800X480，但是在电容触摸屏是8xx*480的就是比800要大的地方就变成了虚拟按键，模拟了android标准按键。</p>
<h1>2    方案</h1>
<p>要实现，虚拟按键，在android里面是靠两层协助实现，底层要把虚拟按键在比显示屏多出的地方规定好虚拟按键的位置大小以及键值等，给上层一文件接口。上层java层启动一个服务来读取这一区域的按键响应，这样就是大体的架构。具体实现如下：</p>
<h3>2.1    底层虚拟按键功能实现方案</h3>
<p>简而言之，就是在内核中把虚拟按键的所有信息给上层给出，用什么方式？就是用sys文件系统的方式，sys文件系统的路径是约定好的所以代码如下实现。给出信息的协议格式是一段连续的字符串，每个按键有六项分别用冒号分割，按键按键之间也是用冒号分割，六项按顺序分别是：</p>
<p><code>键类型:键值:按键区域中心x坐标:按键区域中心y坐标:按键区域宽:按键区域高</code></p>
<p>arch/arm/mach-msm/board-mahimahi.c</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">static</span> ssize_t mahimahi_virtual_keys_show<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> kobject <span style="color: #339933;">*</span>kobj<span style="color: #339933;">,</span>
			       <span style="color: #993333;">struct</span> kobj_attribute <span style="color: #339933;">*</span>attr<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>buf<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>system_rev <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #808080; font-style: italic;">/* center: x: back: 55, menu: 172, home: 298, search 412, y: 835 */</span>
		<span style="color: #b1b100;">return</span> sprintf<span style="color: #009900;">&#40;</span>buf<span style="color: #339933;">,</span>
			__stringify<span style="color: #009900;">&#40;</span>EV_KEY<span style="color: #009900;">&#41;</span> <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>KEY_BACK<span style="color: #009900;">&#41;</span>  <span style="color: #ff0000;">&quot;:55:835:90:55&quot;</span>
		   <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>EV_KEY<span style="color: #009900;">&#41;</span> <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>KEY_MENU<span style="color: #009900;">&#41;</span>   <span style="color: #ff0000;">&quot;:172:835:125:55&quot;</span>
		   <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>EV_KEY<span style="color: #009900;">&#41;</span> <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>KEY_HOME<span style="color: #009900;">&#41;</span>   <span style="color: #ff0000;">&quot;:298:835:115:55&quot;</span>
		   <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>EV_KEY<span style="color: #009900;">&#41;</span> <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>KEY_SEARCH<span style="color: #009900;">&#41;</span> <span style="color: #ff0000;">&quot;:412:835:95:55&quot;</span>
		   <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #808080; font-style: italic;">/* center: x: home: 55, menu: 185, back: 305, search 425, y: 835 */</span>
		<span style="color: #b1b100;">return</span> sprintf<span style="color: #009900;">&#40;</span>buf<span style="color: #339933;">,</span>
			__stringify<span style="color: #009900;">&#40;</span>EV_KEY<span style="color: #009900;">&#41;</span> <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>KEY_HOME<span style="color: #009900;">&#41;</span>  <span style="color: #ff0000;">&quot;:55:835:70:55&quot;</span>
		   <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>EV_KEY<span style="color: #009900;">&#41;</span> <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>KEY_MENU<span style="color: #009900;">&#41;</span>   <span style="color: #ff0000;">&quot;:185:835:100:55&quot;</span>
		   <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>EV_KEY<span style="color: #009900;">&#41;</span> <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>KEY_BACK<span style="color: #009900;">&#41;</span>   <span style="color: #ff0000;">&quot;:305:835:70:55&quot;</span>
		   <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>EV_KEY<span style="color: #009900;">&#41;</span> <span style="color: #ff0000;">&quot;:&quot;</span> __stringify<span style="color: #009900;">&#40;</span>KEY_SEARCH<span style="color: #009900;">&#41;</span> <span style="color: #ff0000;">&quot;:425:835:70:55&quot;</span>
		   <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">struct</span> kobj_attribute mahimahi_virtual_keys_attr <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	.<span style="color: #202020;">attr</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
		.<span style="color: #202020;">name</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;virtualkeys.synaptics-rmi-touchscreen&quot;</span><span style="color: #339933;">,</span>
		.<span style="color: #202020;">mode</span> <span style="color: #339933;">=</span> S_IRUGO<span style="color: #339933;">,</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	.<span style="color: #202020;">show</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>mahimahi_virtual_keys_show<span style="color: #339933;">,</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">struct</span> attribute <span style="color: #339933;">*</span>mahimahi_properties_attrs<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>mahimahi_virtual_keys_attr.<span style="color: #202020;">attr</span><span style="color: #339933;">,</span>
	NULL
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">struct</span> attribute_group mahimahi_properties_attr_group <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	.<span style="color: #202020;">attrs</span> <span style="color: #339933;">=</span> mahimahi_properties_attrs<span style="color: #339933;">,</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">struct</span> kobject <span style="color: #339933;">*</span>properties_kobj<span style="color: #339933;">;</span>
&nbsp;
properties_kobj <span style="color: #339933;">=</span> kobject_create_and_add<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;board_properties&quot;</span><span style="color: #339933;">,</span> NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>properties_kobj<span style="color: #009900;">&#41;</span>
	ret <span style="color: #339933;">=</span> sysfs_create_group<span style="color: #009900;">&#40;</span>properties_kobj<span style="color: #339933;">,</span>
					 <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>mahimahi_properties_attr_group<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>properties_kobj <span style="color: #339933;">||</span> ret<span style="color: #009900;">&#41;</span>
	pr_err<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;failed to create board_properties<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>2.2    JAVA上层方案</h3>
<p>Java层主要是读取按键信息，然后经过一定的算法，来识别虚拟按键，基本不需要修改，但最好还是熟悉java层的架构这样出问题的时候利于定位<br />
frameworks/base/services/java/com/android/server/KeyInputQueue.java</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*这是虚拟按键的类里面包括了VirtualKey所用到的成员变量和按键定位方法*/</span>
    <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> VirtualKey <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">int</span> scancode<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> centerx<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> centery<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> width<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> height<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">int</span> hitLeft<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> hitTop<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> hitRight<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> hitBottom<span style="color: #339933;">;</span>
&nbsp;
        InputDevice lastDevice<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> lastKeycode<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">boolean</span> checkHit<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> x, <span style="color: #000066; font-weight: bold;">int</span> y<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>x <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;=</span> hitLeft <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> x <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;=</span> hitRight                     <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> y <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;=</span> hitTop <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> y <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;=</span> hitBottom<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">void</span> computeHitRect<span style="color: #009900;">&#40;</span>InputDevice dev, <span style="color: #000066; font-weight: bold;">int</span> dw, <span style="color: #000066; font-weight: bold;">int</span> dh<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>dev <span style="color: #339933;">==</span> lastDevice<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>DEBUG_VIRTUAL_KEYS<span style="color: #009900;">&#41;</span> Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;computeHitRect for &quot;</span> <span style="color: #339933;">+</span> scancode
                    <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;: dev=&quot;</span> <span style="color: #339933;">+</span> dev <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; absX=&quot;</span> <span style="color: #339933;">+</span> dev.<span style="color: #006633;">absX</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; absY=&quot;</span> <span style="color: #339933;">+</span> dev.<span style="color: #006633;">absY</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            lastDevice <span style="color: #339933;">=</span> dev<span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">int</span> minx <span style="color: #339933;">=</span> dev.<span style="color: #006633;">absX</span>.<span style="color: #006633;">minValue</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">int</span> maxx <span style="color: #339933;">=</span> dev.<span style="color: #006633;">absX</span>.<span style="color: #006633;">maxValue</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">int</span> halfw <span style="color: #339933;">=</span> width<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">int</span> left <span style="color: #339933;">=</span> centerx <span style="color: #339933;">-</span> halfw<span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">int</span> right <span style="color: #339933;">=</span> centerx <span style="color: #339933;">+</span> halfw<span style="color: #339933;">;</span>
            hitLeft <span style="color: #339933;">=</span> minx <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>left<span style="color: #339933;">*</span>maxx<span style="color: #339933;">-</span>minx<span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>dw<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            hitRight <span style="color: #339933;">=</span> minx <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>right<span style="color: #339933;">*</span>maxx<span style="color: #339933;">-</span>minx<span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>dw<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">int</span> miny <span style="color: #339933;">=</span> dev.<span style="color: #006633;">absY</span>.<span style="color: #006633;">minValue</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">int</span> maxy <span style="color: #339933;">=</span> dev.<span style="color: #006633;">absY</span>.<span style="color: #006633;">maxValue</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">int</span> halfh <span style="color: #339933;">=</span> height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">int</span> top <span style="color: #339933;">=</span> centery <span style="color: #339933;">-</span> halfh<span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">int</span> bottom <span style="color: #339933;">=</span> centery <span style="color: #339933;">+</span> halfh<span style="color: #339933;">;</span>
            hitTop <span style="color: #339933;">=</span> miny <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>top<span style="color: #339933;">*</span>maxy<span style="color: #339933;">-</span>miny<span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>dh<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            hitBottom <span style="color: #339933;">=</span> miny <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>bottom<span style="color: #339933;">*</span>maxy<span style="color: #339933;">-</span>miny<span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>dh<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">/*以下就是与底层接口的函数，如果这个函数和底层接口正常，基本上虚拟按键就能够ok*/</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> readVirtualKeys<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> deviceName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">FileInputStream</span> fis <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileInputStream</span><span style="color: #009900;">&#40;</span>
                    <span style="color: #0000ff;">&quot;/sys/board_properties/virtualkeys.&quot;</span> <span style="color: #339933;">+</span> deviceName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/*这里就是读取kernel给出信息的地方，也就是地层与上层接口的地方，所以整个实现的重点就是这里*/</span>
            <span style="color: #003399;">InputStreamReader</span> isr <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">InputStreamReader</span><span style="color: #009900;">&#40;</span>fis<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">BufferedReader</span> br <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedReader</span><span style="color: #009900;">&#40;</span>isr, <span style="color: #cc66cc;">2048</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">String</span> str <span style="color: #339933;">=</span> br.<span style="color: #006633;">readLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>str <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> it <span style="color: #339933;">=</span> str.<span style="color: #006633;">split</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;:&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>DEBUG_VIRTUAL_KEYS<span style="color: #009900;">&#41;</span> Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;***** VIRTUAL KEYS: &quot;</span> <span style="color: #339933;">+</span> it<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> N <span style="color: #339933;">=</span> it.<span style="color: #006633;">length</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">6</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;=</span>N<span style="color: #339933;">;</span> i<span style="color: #339933;">+=</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #0000ff;">&quot;0x01&quot;</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>it<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        Log.<span style="color: #006633;">w</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;Unknown virtual key type at elem #&quot;</span> <span style="color: #339933;">+</span> i
                                <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;: &quot;</span> <span style="color: #339933;">+</span> it<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">continue</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                    <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
                        VirtualKey sb <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> VirtualKey<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        sb.<span style="color: #006633;">scancode</span> <span style="color: #339933;">=</span> <span style="color: #003399;">Integer</span>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>it<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        sb.<span style="color: #006633;">centerx</span> <span style="color: #339933;">=</span> <span style="color: #003399;">Integer</span>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>it<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">+</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        sb.<span style="color: #006633;">centery</span> <span style="color: #339933;">=</span> <span style="color: #003399;">Integer</span>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>it<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">+</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        sb.<span style="color: #006633;">width</span> <span style="color: #339933;">=</span> <span style="color: #003399;">Integer</span>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>it<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">+</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        sb.<span style="color: #006633;">height</span> <span style="color: #339933;">=</span> <span style="color: #003399;">Integer</span>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>it<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">+</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>DEBUG_VIRTUAL_KEYS<span style="color: #009900;">&#41;</span> Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;Virtual key &quot;</span>
                                <span style="color: #339933;">+</span> sb.<span style="color: #006633;">scancode</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;: center=&quot;</span> <span style="color: #339933;">+</span> sb.<span style="color: #006633;">centerx</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;,&quot;</span>
                                <span style="color: #339933;">+</span> sb.<span style="color: #006633;">centery</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; size=&quot;</span> <span style="color: #339933;">+</span> sb.<span style="color: #006633;">width</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;x&quot;</span>
                                <span style="color: #339933;">+</span> sb.<span style="color: #006633;">height</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        mVirtualKeys.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>sb<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">NumberFormatException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        Log.<span style="color: #006633;">w</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;Bad number at region &quot;</span> <span style="color: #339933;">+</span> i <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; in: &quot;</span>
                                <span style="color: #339933;">+</span> str, e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            br.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">FileNotFoundException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            Log.<span style="color: #006633;">i</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;No virtual keys found&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IOException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            Log.<span style="color: #006633;">w</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;Error reading virtual keys&quot;</span>, e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<h3>2.3    总结</h3>
<p>方案基本上就是这样，主要是调试工作可能需要一段时间，还有如果要做虚拟按键，还需要硬件的支持（超过显示区域的触摸屏区域）。本代码基于android 2.1请根据实际情况修改</p>

	标签：<a href="http://cyher.net/tag/android" title="android" rel="tag">android</a>, <a href="http://cyher.net/tag/driver" title="driver" rel="tag">driver</a>, <a href="http://cyher.net/tag/kernel" title="kernel" rel="tag">kernel</a>, <a href="http://cyher.net/tag/linux" title="linux" rel="tag">linux</a>, <a href="http://cyher.net/tag/virualkey" title="virualkey" rel="tag">virualkey</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://cyher.net/gnulinux/android/android-driver-jogball" title="android驱动之jogball (2010年03月16号)">android驱动之jogball</a> (2)</li>
	<li><a href="http://cyher.net/gnulinux/macbook-pro-ubuntu10-4-bcm-wireless-driver" title="macbook pro ubuntu10.4 bcm无线网卡问题修复 (2010年05月2号)">macbook pro ubuntu10.4 bcm无线网卡问题修复</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/android/android-phone-powermanagement" title="Android 手机电源管理实例 &#8211; milestone (2010年07月25号)">Android 手机电源管理实例 &#8211; milestone</a> (1)</li>
	<li><a href="http://cyher.net/gnulinux/%e5%ad%a6%e4%b9%a0%e7%bb%8f%e9%aa%8c" title="自己的嵌入式学习经验, 想不到别人给拍成视频了 (2009年08月9号)">自己的嵌入式学习经验, 想不到别人给拍成视频了</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/%e8%87%aa%e5%b7%b1%e6%9b%be%e7%bb%8f%e4%bd%9c%e8%bf%87%e7%9a%84%e5%b0%8f%e5%ae%9e%e9%aa%8c" title="自己曾经作过的小实验 (2009年08月16号)">自己曾经作过的小实验</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://cyher.net/gnulinux/android/virualkey/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>android驱动之jogball</title>
		<link>http://cyher.net/gnulinux/android/android-driver-jogball</link>
		<comments>http://cyher.net/gnulinux/android/android-driver-jogball#comments</comments>
		<pubDate>Tue, 16 Mar 2010 09:18:16 +0000</pubDate>
		<dc:creator>cyher</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://cyher.net/?p=637024</guid>
		<description><![CDATA[1 简介
JogBall是首款Android手机-HTC Dream上附带的类似轨迹球Trackball的滑轮，通过Jogball用户可以轻松的实现网页的翻页、地图翻
转等操作，这种在手机上增加轨迹球的方式可以取消传统的4维导航键，Jogball并非HTC公司的首例，早在HTC 3300(Dopod P800)就
实现了这项功能，轨迹球操作方式的加入可以实现像电脑上鼠标一样轻松操控。现在jogball基本上算是android手机的标准配置了。
2 框图&#38;架构


2.1    gpio_event子系统
Jogball驱动是由linux代码中的gpio_event子系统实现的。
由以下文件组成：

 driver/input/misc/gpio_event.c
 driver/input/misc/gpio_input.c
 driver/input/misc/gpio_output.c
 driver/input/misc/gpio_matrix.c
 driver/input/misc/gpio_axis.c

gpio_event子系统是一个关于gpio的输入设备的通用代码，里面可以包含一般嵌入式设备中需要的键盘阵列和坐标有关的输入等。
2.2 Jogball架构
Jogball是归类于gpio_axis.c中的，是一个相对坐标系，判断电信号的高低来对坐标加或者减一定数值。具体细节在gpio_axis.c中
gpio_axis.c中的结构体初始化是在xxx-borad.c中的，基本架构就是这样，细节在下文叙述。
3 硬件描述


3.1 Jogball机械特性
Jogball是一个基于滚球滚动的输入设备，所以它机械特性也是比较重要，知道他的机械特性，便于我们理解驱动。
Jogball和以前的滚球鼠标比较相似，依靠滚轮的滚动来带动四周的圆柱体旋转。每个圆柱体端头都有一个磁铁，这个磁体铁从横断
面来看就是由N极的扇形和S极的扇形来组成一个圆周。这样当磁铁旋转的时候，N极和S极切换，使霍尔IC产生高低电平。
注意：在滚球旋转时，两个相对方向只有一个方向可以转动，这是为了减化软件编写的一个机械特性。
3.2 Jogball的电气特性
Jogball最重要的电特性就是这个霍尔IC，
霍尔元件的工作原理：所谓霍尔效应，是指磁场作用于载流金属导体、半导体中的载流子时，产生横向电位差的物理现
象。金属的霍尔效应是1879年被美 国物理学家霍尔发现的。当电流通过金属箔片时，若在垂直于电流的方向施加磁场，则金属箔片
两侧面会出现横向电位差。半导体中的霍尔效应比金属箔片中更为明 显，而铁磁金属在居里温度以下将呈现极强的霍尔效应。
所以jogball是旋转磁轴引起磁场的变幻，来产生高低电压的。从而根据机械特性就不难理解jogball的数字输入过程。
3.3 Jogball的原理图
其实jogball只是机械结构,原理图是hall ic的,有兴趣的人在这里下载
4 数据结构

struct hero_axis_info &#123;
        struct gpio_event_axis_info info; /*gpio_event_axis结构的信息*/
        uint16_t in_state;/*记录输入的高低电平信号*/
        uint16_t out_state;/*记录输出的高低电平信号*/
 [...]]]></description>
			<content:encoded><![CDATA[<h1><span style="color: #000000;">1 简介</span></h1>
<p>JogBall是首款Android手机-HTC Dream上附带的类似轨迹球Trackball的滑轮，通过Jogball用户可以轻松的实现网页的翻页、地图翻</p>
<p>转等操作，这种在手机上增加轨迹球的方式可以取消传统的4维导航键，Jogball并非HTC公司的首例，早在HTC 3300(Dopod P800)就</p>
<p>实现了这项功能，轨迹球操作方式的加入可以实现像电脑上鼠标一样轻松操控。现在jogball基本上算是android手机的标准配置了。</p>
<h1><span style="color: #000000;">2 框图&amp;架构</span></h1>
<p><span style="color: #000000;"><br />
</span></p>
<h3><span style="color: #000000;">2.1    gpio_event子系统</span></h3>
<p>Jogball驱动是由linux代码中的gpio_event子系统实现的。<br />
由以下文件组成：</p>
<ul>
<li> driver/input/misc/gpio_event.c</li>
<li> driver/input/misc/gpio_input.c</li>
<li> driver/input/misc/gpio_output.c</li>
<li> driver/input/misc/gpio_matrix.c</li>
<li> driver/input/misc/gpio_axis.c</li>
</ul>
<p>gpio_event子系统是一个关于gpio的输入设备的通用代码，里面可以包含一般嵌入式设备中需要的键盘阵列和坐标有关的输入等。</p>
<h3><span style="color: #000000;">2.2 Jogball架构</span></h3>
<p>Jogball是归类于gpio_axis.c中的，是一个相对坐标系，判断电信号的高低来对坐标加或者减一定数值。具体细节在gpio_axis.c中</p>
<p>gpio_axis.c中的结构体初始化是在xxx-borad.c中的，基本架构就是这样，细节在下文叙述。</p>
<h1><span style="color: #000000;">3 硬件描述</span></h1>
<p><span style="color: #000000;"><br />
</span></p>
<h3><span style="color: #000000;">3.1 Jogball机械特性</span></h3>
<p>Jogball是一个基于滚球滚动的输入设备，所以它机械特性也是比较重要，知道他的机械特性，便于我们理解驱动。<br />
Jogball和以前的滚球鼠标比较相似，依靠滚轮的滚动来带动四周的圆柱体旋转。每个圆柱体端头都有一个磁铁，这个磁体铁从横断</p>
<p>面来看就是由N极的扇形和S极的扇形来组成一个圆周。这样当磁铁旋转的时候，N极和S极切换，使霍尔IC产生高低电平。<br />
注意：在滚球旋转时，两个相对方向只有一个方向可以转动，这是为了减化软件编写的一个机械特性。</p>
<h3><span style="color: #000000;">3.2 Jogball的电气特性</span></h3>
<p>Jogball最重要的电特性就是这个霍尔IC，</p>
<blockquote><p>霍尔元件的工作原理：所谓霍尔效应，是指磁场作用于载流金属导体、半导体中的载流子时，产生横向电位差的物理现</p>
<p>象。金属的霍尔效应是1879年被美 国物理学家霍尔发现的。当电流通过金属箔片时，若在垂直于电流的方向施加磁场，则金属箔片</p>
<p>两侧面会出现横向电位差。半导体中的霍尔效应比金属箔片中更为明 显，而铁磁金属在居里温度以下将呈现极强的霍尔效应。</p></blockquote>
<p>所以jogball是旋转磁轴引起磁场的变幻，来产生高低电压的。从而根据机械特性就不难理解jogball的数字输入过程。</p>
<p>3.3 Jogball的原理图</p>
<p>其实jogball只是机械结构,原理图是hall ic的,有兴趣的人在<a href="http://www.datasheetarchive.com/pdf-datasheets/Datasheets-24/DSA-469829.pdf" target="_blank">这里下载</a></p>
<h1><span style="color: #000000;">4 数据结构</span></h1>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">struct</span> hero_axis_info <span style="color: #009900;">&#123;</span>
        <span style="color: #993333;">struct</span> gpio_event_axis_info info<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*gpio_event_axis结构的信息*/</span>
        uint16_t in_state<span style="color: #339933;">;</span><span style="color: #808080; font-style: italic;">/*记录输入的高低电平信号*/</span>
        uint16_t out_state<span style="color: #339933;">;</span><span style="color: #808080; font-style: italic;">/*记录输出的高低电平信号*/</span>
        uint16_t temp_state<span style="color: #339933;">;</span><span style="color: #808080; font-style: italic;">/*临时存储高低电平*/</span>
        uint16_t threshold<span style="color: #339933;">;</span><span style="color: #808080; font-style: italic;">/*门限值，超过这个值上报给input子系统*/</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">struct</span> gpio_event_axis_info <span style="color: #009900;">&#123;</span>
        <span style="color: #808080; font-style: italic;">/* initialize to gpio_event_axis_func */</span>
        <span style="color: #993333;">struct</span> gpio_event_info info<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*gpio_event信息*/</span>
        uint8_t  count<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*gpio的数量*/</span>
        uint8_t  type<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/* EV_REL or EV_ABS */</span>
        uint16_t code<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*输入键值类型*/</span>
        uint16_t decoded_size<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*gpio 数组的大小*/</span>
        uint16_t <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>map<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> gpio_event_axis_info <span style="color: #339933;">*</span>info<span style="color: #339933;">,</span> uint16_t in<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*解析回调函数*/</span>
        uint32_t <span style="color: #339933;">*</span>gpio<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*gpio端口数组*/</span>
        uint32_t flags<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*调试标值*/</span>
        uint32_t enable_emc_protect_delay<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*保护间隔时间*/</span>
        uint16_t emc_gpio_state<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/* 延时中用到gpio_state*/</span>
        atomic_t emc_disable_irqnum<span style="color: #339933;">;</span><span style="color: #808080; font-style: italic;">/*延时中用到的屏蔽的中断号*/</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">struct</span> gpio_event_info <span style="color: #009900;">&#123;</span>
        <span style="color: #993333;">int</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>func<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> input_dev <span style="color: #339933;">*</span>input_dev<span style="color: #339933;">,</span>
        <span style="color: #993333;">struct</span> gpio_event_info <span style="color: #339933;">*</span>info<span style="color: #339933;">,</span>
        <span style="color: #993333;">void</span> <span style="color: #339933;">**</span>data<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> func<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #808080; font-style: italic;">/*给gpio_event子系统中实现注册到内核中的回调函数*/</span>
        <span style="color: #993333;">int</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> input_dev <span style="color: #339933;">*</span>input_dev<span style="color: #339933;">,</span>
        <span style="color: #993333;">struct</span> gpio_event_info <span style="color: #339933;">*</span>info<span style="color: #339933;">,</span>
        <span style="color: #993333;">void</span> <span style="color: #339933;">**</span>data<span style="color: #339933;">,</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> type<span style="color: #339933;">,</span>
        <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> code<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/* out events */</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">struct</span> gpio_event_platform_data <span style="color: #009900;">&#123;</span>
        <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>name<span style="color: #339933;">;</span><span style="color: #808080; font-style: italic;">/*名字*/</span>
        <span style="color: #993333;">struct</span> gpio_event_info <span style="color: #339933;">**</span>info<span style="color: #339933;">;</span><span style="color: #808080; font-style: italic;">/*gpio_event的结构指针*/</span>
        size_t info_count<span style="color: #339933;">;</span><span style="color: #808080; font-style: italic;">/*注册到axis中的info 结构体的数量*/</span>
        <span style="color: #993333;">int</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>power<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">const</span> <span style="color: #993333;">struct</span> gpio_event_platform_data <span style="color: #339933;">*</span>pdata<span style="color: #339933;">,</span> bool on<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #808080; font-style: italic;">/*电源管理回调函数*/</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<h1><span style="color: #000000;">5 代码分析</span></h1>
<h3><span style="color: #000000;">5.1 通用代码</span></h3>
<p>driver/input/misc/gpio_event.c</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*gpio_event基本数据结构*/</span>
<span style="color: #993333;">struct</span> gpio_event <span style="color: #009900;">&#123;</span>
        <span style="color: #993333;">struct</span> input_dev <span style="color: #339933;">*</span>input_dev<span style="color: #339933;">;</span>
        <span style="color: #993333;">const</span> <span style="color: #993333;">struct</span> gpio_event_platform_data <span style="color: #339933;">*</span>info<span style="color: #339933;">;</span>
        <span style="color: #993333;">struct</span> early_suspend early_suspend<span style="color: #339933;">;</span>
        <span style="color: #993333;">void</span> <span style="color: #339933;">*</span>state<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*注册给input的回调函数*/</span>
<span style="color: #993333;">static</span> <span style="color: #993333;">int</span> gpio_input_event<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> input_dev <span style="color: #339933;">*</span>dev<span style="color: #339933;">,</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> type<span style="color: #339933;">,</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> code<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> value<span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*调用下层给的回调函数来实现具体的注册*/</span>
<span style="color: #993333;">static</span> <span style="color: #993333;">int</span> gpio_event_call_all_func<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> gpio_event <span style="color: #339933;">*</span>ip<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> func<span style="color: #009900;">&#41;</span>
<span style="color: #808080; font-style: italic;">/*电源管理*/</span>
<span style="color: #339933;">#ifdef CONFIG_HAS_EARLYSUSPEND</span>
<span style="color: #993333;">void</span> gpio_event_suspend<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> early_suspend <span style="color: #339933;">*</span>h<span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #993333;">void</span> gpio_event_resume<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> early_suspend <span style="color: #339933;">*</span>h<span style="color: #009900;">&#41;</span>
<span style="color: #339933;">#endif</span>
<span style="color: #808080; font-style: italic;">/*注册*/</span>
<span style="color: #993333;">static</span> <span style="color: #993333;">int</span> __init gpio_event_probe<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> platform_device <span style="color: #339933;">*</span>pdev<span style="color: #009900;">&#41;</span>
<span style="color: #808080; font-style: italic;">/*注销*/</span>
<span style="color: #993333;">static</span> <span style="color: #993333;">int</span> gpio_event_remove<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> platform_device <span style="color: #339933;">*</span>pdev<span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">struct</span> platform_driver gpio_event_driver
<span style="color: #993333;">static</span> <span style="color: #993333;">int</span> __devinit gpio_event_init<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> __exit gpio_event_exit<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>gpio_event.c:主要是gpio_event子系统的框架</p>
<h3><span style="color: #000000;">5.2    soc代码</span></h3>
<p>driver/input/misc/gpio_axis.c</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">struct</span> gpio_axis_state <span style="color: #009900;">&#123;</span>
<span style="color: #993333;">struct</span> input_dev <span style="color: #339933;">*</span>input_dev<span style="color: #339933;">;</span><span style="color: #808080; font-style: italic;">/*input设备结构*/</span>
<span style="color: #993333;">struct</span> gpio_event_axis_info <span style="color: #339933;">*</span>info<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*坐标系数据结构*/</span>
uint32_t pos<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*位置*/</span>
<span style="color: #993333;">struct</span> hrtimer emc_hrtimer_delay<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/* 延时时间*/</span>
atomic_t atomic_emc_hrtimer_is_run<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*延时的原子变量*/</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #808080; font-style: italic;">/*上报input数据*/</span>
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gpio_event_update_axis<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> gpio_axis_state <span style="color: #339933;">*</span>as<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> report<span style="color: #009900;">&#41;</span>
<span style="color: #808080; font-style: italic;">/*时间处理函数*/</span>
<span style="color: #993333;">static</span> <span style="color: #000000; font-weight: bold;">enum</span> hrtimer_restart emc_progress_hrtimer_handler_func<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> hrtimer <span style="color: #339933;">*</span>timer<span style="color: #009900;">&#41;</span>
<span style="color: #808080; font-style: italic;">/*中断处理函数*/</span>
<span style="color: #993333;">static</span> irqreturn_t gpio_axis_irq_handler<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> irq<span style="color: #339933;">,</span> <span style="color: #993333;">void</span> <span style="color: #339933;">*</span>dev_id<span style="color: #009900;">&#41;</span>
<span style="color: #808080; font-style: italic;">/*给上层的注册回调函数*/</span>
<span style="color: #993333;">int</span> gpio_event_axis_func<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> input_dev <span style="color: #339933;">*</span>input_dev<span style="color: #339933;">,</span> <span style="color: #993333;">struct</span> gpio_event_info <span style="color: #339933;">*</span>info<span style="color: #339933;">,</span> <span style="color: #993333;">void</span> <span style="color: #339933;">**</span>data<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> func<span style="color: #009900;">&#41;</span></pre></div></div>

<h3><span style="color: #000000;">5.3    platform代码</span></h3>
<p>例如：/arch/arm/match-msm/board-72&#215;7.c</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">uint16_t hero_axis_map<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> gpio_event_axis_info <span style="color: #339933;">*</span>info<span style="color: #339933;">,</span> uint16_t in<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
        <span style="color: #993333;">struct</span> hero_axis_info <span style="color: #339933;">*</span>ai <span style="color: #339933;">=</span> container_of<span style="color: #009900;">&#40;</span>info<span style="color: #339933;">,</span> <span style="color: #993333;">struct</span> hero_axis_info<span style="color: #339933;">,</span> info<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        uint16_t out <span style="color: #339933;">=</span> ai<span style="color: #339933;">-&gt;</span>out_state<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>nav_just_on<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>jiffies <span style="color: #339933;">==</span> nav_on_jiffies <span style="color: #339933;">||</span> jiffies <span style="color: #339933;">==</span> nav_on_jiffies <span style="color: #339933;">+</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span>
                <span style="color: #b1b100;">goto</span> ignore<span style="color: #339933;">;</span>
        nav_just_on <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>ai<span style="color: #339933;">-&gt;</span>in_state <span style="color: #339933;">^</span> in<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #808080; font-style: italic;">/*检测在方向1上有没有数值变化*/</span>
        out<span style="color: #339933;">--;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>ai<span style="color: #339933;">-&gt;</span>n_state <span style="color: #339933;">^</span> in<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #808080; font-style: italic;">/*检测在方向1相对方向上有没有数值变化*/</span>
        out<span style="color: #339933;">++;</span>
ai<span style="color: #339933;">-&gt;;</span>out_state <span style="color: #339933;">=</span> out<span style="color: #339933;">;</span>
ignore<span style="color: #339933;">:</span>
        ai<span style="color: #339933;">-&gt;</span>in_state <span style="color: #339933;">=</span> in<span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>ai<span style="color: #339933;">-&gt;</span>out_state <span style="color: #339933;">-</span> ai<span style="color: #339933;">-&gt;</span>temp_state <span style="color: #339933;">==</span> ai<span style="color: #339933;">-&gt;</span>threshold<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        ai<span style="color: #339933;">-&gt;</span>temp_state<span style="color: #339933;">++;</span>
        ai<span style="color: #339933;">-&gt;</span>out_state <span style="color: #339933;">=</span> ai<span style="color: #339933;">-&gt;</span>temp_state<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>ai<span style="color: #339933;">-&gt;</span>temp_state <span style="color: #339933;">-</span> ai<span style="color: #339933;">-</span>out_state <span style="color: #339933;">==</span> ai<span style="color: #339933;">-&gt;</span>threshold<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        ai<span style="color: #339933;">-&gt;</span>temp_state<span style="color: #339933;">--;</span>
        ai<span style="color: #339933;">-&gt;</span>out_state <span style="color: #339933;">=</span> ai<span style="color: #339933;">-&gt;</span>temp_state<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>abs<span style="color: #009900;">&#40;</span>ai<span style="color: #339933;">-&gt;</span>out_state <span style="color: #339933;">-</span> ai<span style="color: #339933;">-&gt;;</span>temp_state<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> ai<span style="color: #339933;">-&gt;</span>threshold<span style="color: #009900;">&#41;</span>
        ai<span style="color: #339933;">-&gt;</span>temp_state <span style="color: #339933;">=</span> ai<span style="color: #339933;">-&gt;</span>out_state<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">return</span> ai<span style="color: #339933;">-&gt;</span>temp_state<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>以上函数，是最终的数据解析函数，也就是把硬件中读出来的数据，转化为实际的位置变化的函数。此函数主要做了差错控制，增加</p>
<p>了程序的鲁棒性和可订制性。</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">static</span> <span style="color: #993333;">struct</span> hero_axis_info hero_x_axis <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
        .<span style="color: #202020;">threshold</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">,</span>
                .<span style="color: #202020;">info</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
                .<span style="color: #202020;">info</span>.<span style="color: #202020;">func</span> <span style="color: #339933;">=</span> gpio_event_axis_func<span style="color: #339933;">,</span>
                .<span style="color: #202020;">count</span> <span style="color: #339933;">=</span> ARRAY_SIZE<span style="color: #009900;">&#40;</span>hero_x_axis_gpios<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                .<span style="color: #202020;">type</span> <span style="color: #339933;">=</span> EV_REL<span style="color: #339933;">,</span>
                .<span style="color: #202020;">code</span> <span style="color: #339933;">=</span> REL_X<span style="color: #339933;">,</span>
                .<span style="color: #202020;">decoded_size</span> <span style="color: #339933;">=</span> 1U <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;&amp;</span>lt<span style="color: #339933;">;</span> ARRAY_SIZE<span style="color: #009900;">&#40;</span>hero_x_axis_gpios<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                .<span style="color: #202020;">map</span> <span style="color: #339933;">=</span> hero_axis_map<span style="color: #339933;">,</span>
                .<span style="color: #202020;">gpio</span> <span style="color: #339933;">=</span> hero_x_axis_gpios<span style="color: #339933;">,</span>
                .<span style="color: #202020;">flags</span> <span style="color: #339933;">=</span> GPIOEAF_PRINT_UNKNOWN_DIRECTION <span style="color: #808080; font-style: italic;">/*| GPIOEAF_PRINT_RAW | GPIOEAF_PRINT_EVENT */</span><span style="color: #339933;">,</span>
                .<span style="color: #202020;">enable_emc_protect_delay</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span> <span style="color: #339933;">*</span> NSEC_PER_MSEC<span style="color: #339933;">,</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>X轴上的info结构体的初始化</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">static</span> <span style="color: #993333;">struct</span> hero_axis_info hero_y_axis <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
        .<span style="color: #202020;">threshold</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">,</span>
                .<span style="color: #202020;">info</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
                .<span style="color: #202020;">info</span>.<span style="color: #202020;">func</span> <span style="color: #339933;">=</span> gpio_event_axis_func<span style="color: #339933;">,</span>
                .<span style="color: #202020;">count</span> <span style="color: #339933;">=</span> ARRAY_SIZE<span style="color: #009900;">&#40;</span>hero_y_axis_gpios<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                .<span style="color: #202020;">type</span> <span style="color: #339933;">=</span> EV_REL<span style="color: #339933;">,</span>
                .<span style="color: #202020;">code</span> <span style="color: #339933;">=</span> REL_Y<span style="color: #339933;">,</span>
                .<span style="color: #202020;">decoded_size</span> <span style="color: #339933;">=</span> 1U <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;&amp;</span>lt<span style="color: #339933;">;</span> ARRAY_SIZE<span style="color: #009900;">&#40;</span>hero_y_axis_gpios<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                .<span style="color: #202020;">map</span> <span style="color: #339933;">=</span> hero_axis_map<span style="color: #339933;">,</span>
                .<span style="color: #202020;">gpio</span> <span style="color: #339933;">=</span> hero_y_axis_gpios<span style="color: #339933;">,</span>
                .<span style="color: #202020;">flags</span> <span style="color: #339933;">=</span> GPIOEAF_PRINT_UNKNOWN_DIRECTION <span style="color: #808080; font-style: italic;">/*| GPIOEAF_PRINT_RAW | GPIOEAF_PRINT_EVENT  */</span><span style="color: #339933;">,</span>
                .<span style="color: #202020;">enable_emc_protect_delay</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span> <span style="color: #339933;">*</span> NSEC_PER_MSEC<span style="color: #339933;">,</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Y轴上的info结构体的初始化</p>
<h1><span style="color: #000000;">6 备注</span></h1>
<p>在android的framework的代码中识别jogball设备是识别成鼠标的特性的，不仅有坐标还是由按键的，但是驱动中并没有axis中并没</p>
<p>有按键，所以在注册input设备的时候要加入按键的键值。如下代码：<br />
在drivers/input/misc/gpio_axis.c中的gpio_event_axis_func函数中</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">as<span style="color: #339933;">-&gt;</span>input_dev <span style="color: #339933;">=</span> input_dev<span style="color: #339933;">;</span>
as<span style="color: #339933;">-&gt;</span>info <span style="color: #339933;">=</span> ai<span style="color: #339933;">;</span>
&nbsp;
input_set_capability<span style="color: #009900;">&#40;</span>input_dev<span style="color: #339933;">,</span> ai<span style="color: #339933;">-&gt;</span>type<span style="color: #339933;">,</span> ai<span style="color: #339933;">-&gt;;</span>code<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>ai<span style="color: #339933;">-&gt;</span>type <span style="color: #339933;">==</span> EV_ABS<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        input_set_abs_params<span style="color: #009900;">&#40;</span>input_dev<span style="color: #339933;">,</span> ai<span style="color: #339933;">-&gt;</span>code<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span>
        ai<span style="color: #339933;">-&gt;</span>decoded_size <span style="color: #339933;">-</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>input_set_capability(input_dev, ai->type, BT_MOUSE);</p>
<p>本文源码是基于hero手机kernel代码<br />
kernel_hero/arch/arm/mach-msm/board-hero.c<br />
下载地址 <a href="http://developer.htc.com/">http://developer.htc.com/</a></p>

	标签：<a href="http://cyher.net/tag/android" title="android" rel="tag">android</a>, <a href="http://cyher.net/tag/driver" title="driver" rel="tag">driver</a>, <a href="http://cyher.net/tag/input" title="input" rel="tag">input</a>, <a href="http://cyher.net/tag/kernel" title="kernel" rel="tag">kernel</a>, <a href="http://cyher.net/tag/linux" title="linux" rel="tag">linux</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://cyher.net/gnulinux/android/virualkey" title="android驱动之虚拟按键 (2010年03月22号)">android驱动之虚拟按键</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/macbook-pro-ubuntu10-4-bcm-wireless-driver" title="macbook pro ubuntu10.4 bcm无线网卡问题修复 (2010年05月2号)">macbook pro ubuntu10.4 bcm无线网卡问题修复</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/android/android-phone-powermanagement" title="Android 手机电源管理实例 &#8211; milestone (2010年07月25号)">Android 手机电源管理实例 &#8211; milestone</a> (1)</li>
	<li><a href="http://cyher.net/gnulinux/%e5%ad%a6%e4%b9%a0%e7%bb%8f%e9%aa%8c" title="自己的嵌入式学习经验, 想不到别人给拍成视频了 (2009年08月9号)">自己的嵌入式学习经验, 想不到别人给拍成视频了</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/%e8%87%aa%e5%b7%b1%e6%9b%be%e7%bb%8f%e4%bd%9c%e8%bf%87%e7%9a%84%e5%b0%8f%e5%ae%9e%e9%aa%8c" title="自己曾经作过的小实验 (2009年08月16号)">自己曾经作过的小实验</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://cyher.net/gnulinux/android/android-driver-jogball/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>linux进程可执行文件的绝对路径</title>
		<link>http://cyher.net/programming/linux-process-absolute-path</link>
		<comments>http://cyher.net/programming/linux-process-absolute-path#comments</comments>
		<pubDate>Thu, 24 Sep 2009 08:55:46 +0000</pubDate>
		<dc:creator>cyher</dc:creator>
				<category><![CDATA[GNU/linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[proc]]></category>

		<guid isPermaLink="false">http://cyher.net/?p=637006</guid>
		<description><![CDATA[这种情况很少遇到，我们需要一个运行中进程的绝对路径，可惜的是glibc中或者系统调用中我都没有找到类似的函数。但是linux绝对不会不给你这个机会的，那就是proc文件系统了。在proc文件系统中那些数字都是运行中的进程，进入一个文件名为数字的文件夹以后，我们就可以发现以下类似文件目录结构。

&#91;cyher@cyher ~&#93;$ ls /proc/3355/
attr             cpuset   io        mountinfo   pagemap      smaps    task
auxv             cwd      latency   mounts      personality  stack    wchan
cgroup           environ  limits    mountstats  root         stat
clear_refs       exe      loginuid  net         sched        statm
cmdline          fd       maps      oom_adj     schedstat    status
coredump_filter  fdinfo   mem       oom_score   sessionid    syscall

这里就是一个进程所有的信息了大名鼎鼎的ps命令就是读取这里的内容解析出信息的，这里是ps的官方网站 http://procps.sourceforge.net/
那好了，就用这里给的信息来解析出执行文件的绝对路径吧

/*
 * =====================================================================================
 *
 *       Filename:  get_exe_path.c
 *
 *    [...]]]></description>
			<content:encoded><![CDATA[<p>这种情况很少遇到，我们需要一个运行中进程的绝对路径，可惜的是glibc中或者系统调用中我都没有找到类似的函数。但是linux绝对不会不给你这个机会的，那就是proc文件系统了。在proc文件系统中那些数字都是运行中的进程，进入一个文件名为数字的文件夹以后，我们就可以发现以下类似文件目录结构。</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>cyher@cyher ~<span style="color: #009900;">&#93;</span>$ ls <span style="color: #339933;">/</span>proc<span style="color: #339933;">/</span><span style="color: #0000dd;">3355</span><span style="color: #339933;">/</span>
attr             cpuset   io        mountinfo   pagemap      smaps    task
auxv             cwd      latency   mounts      personality  stack    wchan
cgroup           environ  limits    mountstats  root         stat
clear_refs       exe      loginuid  net         sched        statm
cmdline          fd       maps      oom_adj     schedstat    status
coredump_filter  fdinfo   mem       oom_score   sessionid    syscall</pre></div></div>

<p>这里就是一个进程所有的信息了大名鼎鼎的ps命令就是读取这里的内容解析出信息的，这里是ps的官方网站 <a href="http://procps.sourceforge.net/" target="_blank">http://procps.sourceforge.net/</a></p>
<p>那好了，就用这里给的信息来解析出执行文件的绝对路径吧</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
 * =====================================================================================
 *
 *       Filename:  get_exe_path.c
 *
 *    Description:
 *
 *        Version:  1.0
 *        Created:  2009年09月23日 17时07分17秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  cyher (), cyher.net@gmail.com
 *        Company:  cyher.net
 *
 * =====================================================================================
 */</span>
&nbsp;
<span style="color: #339933;">#include</span>
<span style="color: #339933;">#include</span>
<span style="color: #339933;">#include</span>
<span style="color: #339933;">#define BUF 128</span>
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> agrc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">**</span>argv<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #993333;">char</span> buf<span style="color: #009900;">&#91;</span>BUF<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #993333;">char</span> proc<span style="color: #009900;">&#91;</span>BUF<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>p<span style="color: #339933;">;</span>
&nbsp;
    sprintf<span style="color: #009900;">&#40;</span>proc<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;/proc/%d/exe&quot;</span><span style="color: #339933;">,</span> atoi<span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    readlink<span style="color: #009900;">&#40;</span>proc<span style="color: #339933;">,</span>buf<span style="color: #339933;">,</span> BUF<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*proc/pid/exe 是一个链接，用readlink读*/</span>
    p <span style="color: #339933;">=</span> strchr<span style="color: #009900;">&#40;</span>buf<span style="color: #339933;">,</span><span style="color: #ff0000;">'('</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/*读出的路径后面有可能会有 (deleted)字样，删去*/</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>p ！<span style="color: #339933;">=</span> NULL<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        p<span style="color: #339933;">--;</span>
        <span style="color: #339933;">*</span>p <span style="color: #339933;">=</span> <span style="color: #ff0000;">'<span style="color: #006699; font-weight: bold;">\0</span>'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    puts<span style="color: #009900;">&#40;</span>buf<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>这样就能读取出绝对路径了，不过你首先要知道pid啊 呵呵。</p>

	标签：<a href="http://cyher.net/tag/c" title="c" rel="tag">c</a>, <a href="http://cyher.net/tag/code" title="code" rel="tag">code</a>, <a href="http://cyher.net/tag/linux" title="linux" rel="tag">linux</a>, <a href="http://cyher.net/tag/proc" title="proc" rel="tag">proc</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://cyher.net/gnulinux/%e5%ad%a6%e4%b9%a0%e7%bb%8f%e9%aa%8c" title="自己的嵌入式学习经验, 想不到别人给拍成视频了 (2009年08月9号)">自己的嵌入式学习经验, 想不到别人给拍成视频了</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/%e8%87%aa%e5%b7%b1%e6%9b%be%e7%bb%8f%e4%bd%9c%e8%bf%87%e7%9a%84%e5%b0%8f%e5%ae%9e%e9%aa%8c" title="自己曾经作过的小实验 (2009年08月16号)">自己曾经作过的小实验</a> (0)</li>
	<li><a href="http://cyher.net/apple/macos-x/technology_is_a_kind_of_belief_appl" title="科技是一种信仰(apple&#038;linux) (2009年01月12号)">科技是一种信仰(apple&#038;linux)</a> (5)</li>
	<li><a href="http://cyher.net/gnulinux/%e6%97%b6%e9%9a%94%e5%87%a0%e4%b8%aa%e6%9c%88%ef%bc%8c%e6%b2%a1%e6%83%b3%e5%88%b0%e6%88%91%e5%8f%88%e7%94%a8%e4%b8%8alinux%e4%ba%86%e3%80%82%e3%80%82%e3%80%82" title="时隔几个月，没想到我又用上linux了。。。 (2008年06月30号)">时隔几个月，没想到我又用上linux了。。。</a> (0)</li>
	<li><a href="http://cyher.net/hardware/%e5%a4%a7%e6%95%8c%e5%bd%93%e5%89%8d-%e5%a1%9e%e7%8f%ad%e5%92%8c%e5%be%ae%e8%bd%af%e5%9d%87%e5%8f%97ubuntu%e5%a8%81%e8%83%81" title="大敌当前 塞班和微软均受Ubuntu威胁 (2007年04月21号)">大敌当前 塞班和微软均受Ubuntu威胁</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://cyher.net/programming/linux-process-absolute-path/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>自己曾经作过的小实验</title>
		<link>http://cyher.net/gnulinux/%e8%87%aa%e5%b7%b1%e6%9b%be%e7%bb%8f%e4%bd%9c%e8%bf%87%e7%9a%84%e5%b0%8f%e5%ae%9e%e9%aa%8c</link>
		<comments>http://cyher.net/gnulinux/%e8%87%aa%e5%b7%b1%e6%9b%be%e7%bb%8f%e4%bd%9c%e8%bf%87%e7%9a%84%e5%b0%8f%e5%ae%9e%e9%aa%8c#comments</comments>
		<pubDate>Sun, 16 Aug 2009 13:45:50 +0000</pubDate>
		<dc:creator>cyher</dc:creator>
				<category><![CDATA[GNU/linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[嵌入式]]></category>

		<guid isPermaLink="false">http://cyher.net/?p=636993</guid>
		<description><![CDATA[
youku链接:http://v.youku.com/v_show/id_XMTAyODE5MjEy.html

	标签：linux, 嵌入式

	相关日志
	
	自己的嵌入式学习经验, 想不到别人给拍成视频了 (0)
	科技是一种信仰(apple&#038;linux) (5)
	时隔几个月，没想到我又用上linux了。。。 (0)
	嵌入式c面试经验，与大家分享 (2)
	对于大学生嵌入式开发的认识 (2)


]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://player.youku.com/player.php/sid/XMTAyODE5MjEy/v.swf" /><embed type="application/x-shockwave-flash" width="480" height="400" src="http://player.youku.com/player.php/sid/XMTAyODE5MjEy/v.swf"></embed></object></p>
<p>youku链接:http://v.youku.com/v_show/id_XMTAyODE5MjEy.html</p>

	标签：<a href="http://cyher.net/tag/linux" title="linux" rel="tag">linux</a>, <a href="http://cyher.net/tag/%e5%b5%8c%e5%85%a5%e5%bc%8f" title="嵌入式" rel="tag">嵌入式</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://cyher.net/gnulinux/%e5%ad%a6%e4%b9%a0%e7%bb%8f%e9%aa%8c" title="自己的嵌入式学习经验, 想不到别人给拍成视频了 (2009年08月9号)">自己的嵌入式学习经验, 想不到别人给拍成视频了</a> (0)</li>
	<li><a href="http://cyher.net/apple/macos-x/technology_is_a_kind_of_belief_appl" title="科技是一种信仰(apple&#038;linux) (2009年01月12号)">科技是一种信仰(apple&#038;linux)</a> (5)</li>
	<li><a href="http://cyher.net/gnulinux/%e6%97%b6%e9%9a%94%e5%87%a0%e4%b8%aa%e6%9c%88%ef%bc%8c%e6%b2%a1%e6%83%b3%e5%88%b0%e6%88%91%e5%8f%88%e7%94%a8%e4%b8%8alinux%e4%ba%86%e3%80%82%e3%80%82%e3%80%82" title="时隔几个月，没想到我又用上linux了。。。 (2008年06月30号)">时隔几个月，没想到我又用上linux了。。。</a> (0)</li>
	<li><a href="http://cyher.net/webthings/%e5%b5%8c%e5%85%a5%e5%bc%8fc%e9%9d%a2%e8%af%95%e7%bb%8f%e9%aa%8c%ef%bc%8c%e4%b8%8e%e5%a4%a7%e5%ae%b6%e5%88%86%e4%ba%ab" title="嵌入式c面试经验，与大家分享 (2008年12月16号)">嵌入式c面试经验，与大家分享</a> (2)</li>
	<li><a href="http://cyher.net/hardware/%e5%af%b9%e4%ba%8e%e5%a4%a7%e5%ad%a6%e7%94%9f%e5%b5%8c%e5%85%a5%e5%bc%8f%e5%bc%80%e5%8f%91%e7%9a%84%e8%ae%a4%e8%af%86" title="对于大学生嵌入式开发的认识 (2007年04月25号)">对于大学生嵌入式开发的认识</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://cyher.net/gnulinux/%e8%87%aa%e5%b7%b1%e6%9b%be%e7%bb%8f%e4%bd%9c%e8%bf%87%e7%9a%84%e5%b0%8f%e5%ae%9e%e9%aa%8c/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>自己的嵌入式学习经验, 想不到别人给拍成视频了</title>
		<link>http://cyher.net/gnulinux/%e5%ad%a6%e4%b9%a0%e7%bb%8f%e9%aa%8c</link>
		<comments>http://cyher.net/gnulinux/%e5%ad%a6%e4%b9%a0%e7%bb%8f%e9%aa%8c#comments</comments>
		<pubDate>Sun, 09 Aug 2009 15:01:17 +0000</pubDate>
		<dc:creator>cyher</dc:creator>
				<category><![CDATA[GNU/linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[学习]]></category>
		<category><![CDATA[嵌入式]]></category>
		<category><![CDATA[工作]]></category>

		<guid isPermaLink="false">http://cyher.net/?p=636988</guid>
		<description><![CDATA[
见笑了&#8230;.呵呵. 说的太年轻气盛了&#8230;.别拍阿,我知错了.现在需要低调&#8230;呵呵.

	标签：linux, 学习, 嵌入式, 工作

	相关日志
	
	自己曾经作过的小实验 (0)
	嵌入式c面试经验，与大家分享 (2)
	科技是一种信仰(apple&#038;linux) (5)
	时隔几个月，没想到我又用上linux了。。。 (0)
	对于大学生嵌入式开发的认识 (2)


]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://player.youku.com/player.php/Type/Folder/Fid/3491370/Ob/1/Pt/1/sid/XOTMzNzQ1NzI=/v.swf" /><embed type="application/x-shockwave-flash" width="480" height="400" src="http://player.youku.com/player.php/Type/Folder/Fid/3491370/Ob/1/Pt/1/sid/XOTMzNzQ1NzI=/v.swf"></embed></object></p>
<p>见笑了&#8230;.呵呵. 说的太年轻气盛了&#8230;.别拍阿,我知错了.现在需要低调&#8230;呵呵.</p>

	标签：<a href="http://cyher.net/tag/linux" title="linux" rel="tag">linux</a>, <a href="http://cyher.net/tag/%e5%ad%a6%e4%b9%a0" title="学习" rel="tag">学习</a>, <a href="http://cyher.net/tag/%e5%b5%8c%e5%85%a5%e5%bc%8f" title="嵌入式" rel="tag">嵌入式</a>, <a href="http://cyher.net/tag/%e5%b7%a5%e4%bd%9c" title="工作" rel="tag">工作</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://cyher.net/gnulinux/%e8%87%aa%e5%b7%b1%e6%9b%be%e7%bb%8f%e4%bd%9c%e8%bf%87%e7%9a%84%e5%b0%8f%e5%ae%9e%e9%aa%8c" title="自己曾经作过的小实验 (2009年08月16号)">自己曾经作过的小实验</a> (0)</li>
	<li><a href="http://cyher.net/webthings/%e5%b5%8c%e5%85%a5%e5%bc%8fc%e9%9d%a2%e8%af%95%e7%bb%8f%e9%aa%8c%ef%bc%8c%e4%b8%8e%e5%a4%a7%e5%ae%b6%e5%88%86%e4%ba%ab" title="嵌入式c面试经验，与大家分享 (2008年12月16号)">嵌入式c面试经验，与大家分享</a> (2)</li>
	<li><a href="http://cyher.net/apple/macos-x/technology_is_a_kind_of_belief_appl" title="科技是一种信仰(apple&#038;linux) (2009年01月12号)">科技是一种信仰(apple&#038;linux)</a> (5)</li>
	<li><a href="http://cyher.net/gnulinux/%e6%97%b6%e9%9a%94%e5%87%a0%e4%b8%aa%e6%9c%88%ef%bc%8c%e6%b2%a1%e6%83%b3%e5%88%b0%e6%88%91%e5%8f%88%e7%94%a8%e4%b8%8alinux%e4%ba%86%e3%80%82%e3%80%82%e3%80%82" title="时隔几个月，没想到我又用上linux了。。。 (2008年06月30号)">时隔几个月，没想到我又用上linux了。。。</a> (0)</li>
	<li><a href="http://cyher.net/hardware/%e5%af%b9%e4%ba%8e%e5%a4%a7%e5%ad%a6%e7%94%9f%e5%b5%8c%e5%85%a5%e5%bc%8f%e5%bc%80%e5%8f%91%e7%9a%84%e8%ae%a4%e8%af%86" title="对于大学生嵌入式开发的认识 (2007年04月25号)">对于大学生嵌入式开发的认识</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://cyher.net/gnulinux/%e5%ad%a6%e4%b9%a0%e7%bb%8f%e9%aa%8c/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在macbook上安装各种操作系统</title>
		<link>http://cyher.net/apple/multi-os-on-macbook</link>
		<comments>http://cyher.net/apple/multi-os-on-macbook#comments</comments>
		<pubDate>Sun, 26 Jul 2009 13:32:39 +0000</pubDate>
		<dc:creator>cyher</dc:creator>
				<category><![CDATA[OS]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[opensolaris]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://cyher.net/?p=636972</guid>
		<description><![CDATA[想在macbook上装操作系统, 但是鉴于macbook于一般pc还不是很相同,所以在发行版的选择上还是有点困难的. 经过我在网上的搜索最后结合我自己的需要,在我的macbook pro上装了ubuntu,opensolaris这两个系统.(别提windows, 他就是用的人多点,其他没有什么可取之处,结论仅限于计算机爱好者).
mac上多系统启动
http://wiki.onmac.net/index.php/Triple_Boot_via_BootCamp_Ubuntu

 ubuntu上装mac
https://wiki.ubuntu.com/MactelSupportTeam/CommunityHelpPages
最后还是选择ubuntu, 这个在资深linuxer中口碑不是很好的系统, 为什么口碑不好, 我想是因为ubuntu的成功有点不劳而获的感觉吧.整个系统建立在debian上,而自身对linux内核和软件库的贡献相对他的成功要少.当然这写东西不是我们要讨论的.为什么我选择了ubuntu装在我的macbook上, 因为我需要的是一个稳定,实用,功能完善的系统,主要作桌面应用和编码而不是作系统研究的OS, ubuntu都支持的非常好,在各大linux发行办中支持的最好了.ubuntu有专门的mac支持的团队,看上面的链接,所以很人性化了,其实最重要的是简单了,我现在的情况估计不允许我长时间编译gentoo&#8230;..
推荐指数: * * * * *
mac上opensolaris
http://wiki.genunix.org/wiki/index.php/OpenSolaris_Dual_Boot
http://blogs.sun.com/judychen/entry/在macbook_pro上安装solaris
http://www.weiphone.com/viewthread.php?tid=208850
http://developers.sun.com.cn/solaris/opensolaris_2005_mac.html#author
http://wikis.sun.com/display/chosug/OpenSolaris+2009.06+on+a+MacBook+Pro
solaris,哈,同样经典的unix, 现在有opensolaris项目能够跑在x86体系上,看上面的链接就知道sun和apple的关系还是不错的,opensolaris有很好的官方支持macbook.所以希望了解solaris的童鞋不能错过了.我跟人对opensolaris也是一知半解就不多说了,不过感觉不错.
推荐值数: * * * *
mac上debian
http://wiki.debian.org/MacBook
debian,最古老,软件包最多,最自由,最有linux精神的发行版之一,是ubuntu他爹,同样对macbook支持不错,就是配置起来稍微geek点, 喜欢钻研系统的高手们,推荐使用.
推荐指数: * * * *
mac上gentoo
http://www.odi.ch/prog/macbookpro/index.php
gentoo,包管理系统借鉴bsd的port, 全部源码自编译, 高手以及时间充裕的人,我相信一定能做出最适合自己,速度最快的linux. gentoo的意思是一种游的最快的企鹅.
推荐指数: * * *
mac上opensuse
http://en.opensuse.org/Installation_on_MacBook
opensuse, 华丽, 企业级高端应用, top500的超级计算机很多用的都是suse,这是为什么呢?我也不知道&#8230;想想华丽的suse配上精致的macbook一定感觉不错,但是文档支持一般, 软件支持也一般了.
推荐值数: * *
mac上arch linux
http://wiki.archlinux.org/index.php/MacBook#Mac_OS_X_with_Arch_Linux
http://wiki.archlinux.org/index.php/MacBook_Aluminum
http://wiki.archlinux.org/index.php/MacBookPro
arch linux, 轻量级linux,可定制性高,对i686有特殊优化.　对mac支持还算不错,对于一般用户来说还是要费点事的.arch可能就是gentoo的折衷方案吧.
推荐指数: * * *
mac上fedora
http://www.cenolan.com/2009/06/installing-fedora-11-on-a-macbook/
fedora, redhat支持的开源发行版,那是相当的有实力,我也一直用.但是装在macbook上可能难度不亚于arch或者gentoo,连个官方文档都难找到.不过上面那个链接介绍的已经很清楚了,　喜欢fedora的童鞋别错过了,毕竟fedora还是一个非常不错的发行版.
推荐指数: * * *
mac上freebsd
http://wiki.freebsd.org/AppleMacbook
freebsd, 和mac os x 同属一系. 优秀的架构,很适合作服务器应用, 让我想不到的是,对mac的支持也是相当的不错的,但是用起来还是需要一些经验和技术的,总之,freebsd装在mac上有些怪怪的,不过freebsd还是相当有内涵的OS大家不妨试试.
推荐指数: * [...]]]></description>
			<content:encoded><![CDATA[<p>想在macbook上装操作系统, 但是鉴于macbook于一般pc还不是很相同,所以在发行版的选择上还是有点困难的. 经过我在网上的搜索最后结合我自己的需要,在我的macbook pro上装了ubuntu,opensolaris这两个系统.(别提windows, 他就是用的人多点,其他没有什么可取之处,结论仅限于计算机爱好者).</p>
<p><span style="color: #ff0000;">mac上多系统启动</span><br />
<a href="http://wiki.onmac.net/index.php/Triple_Boot_via_BootCamp_Ubuntu">http://wiki.onmac.net/index.php/Triple_Boot_via_BootCamp_Ubuntu</a></p>
<p><a href="http://wiki.onmac.net/index.php/Triple_Boot_via_BootCamp_Ubuntu"></a><br />
<span style="color: #ff0000;"> ubuntu上装mac</span><br />
<a href="https://wiki.ubuntu.com/MactelSupportTeam/CommunityHelpPages">https://wiki.ubuntu.com/MactelSupportTeam/CommunityHelpPages</a></p>
<p>最后还是选择ubuntu, 这个在资深linuxer中口碑不是很好的系统, 为什么口碑不好, 我想是因为ubuntu的成功有点不劳而获的感觉吧.整个系统建立在debian上,而自身对linux内核和软件库的贡献相对他的成功要少.当然这写东西不是我们要讨论的.为什么我选择了ubuntu装在我的macbook上, 因为我需要的是一个稳定,实用,功能完善的系统,主要作桌面应用和编码而不是作系统研究的OS, ubuntu都支持的非常好,在各大linux发行办中支持的最好了.ubuntu有专门的mac支持的团队,看上面的链接,所以很人性化了,其实最重要的是简单了,我现在的情况估计不允许我长时间编译gentoo&#8230;..</p>
<p>推荐指数: * * * * *</p>
<p><span style="color: #ff0000;">mac上opensolaris</span><br />
<a href="http://wiki.genunix.org/wiki/index.php/OpenSolaris_Dual_Boot">http://wiki.genunix.org/wiki/index.php/OpenSolaris_Dual_Boot</a><br />
<a href="http://blogs.sun.com/judychen/entry/%E5%9C%A8macbook_pro%E4%B8%8A%E5%AE%89%E8%A3%85solaris">http://blogs.sun.com/judychen/entry/在macbook_pro上安装solaris</a><br />
<a href="http://www.weiphone.com/viewthread.php?tid=208850">http://www.weiphone.com/viewthread.php?tid=208850</a><br />
<a href="http://developers.sun.com.cn/solaris/opensolaris_2005_mac.html#author">http://developers.sun.com.cn/solaris/opensolaris_2005_mac.html#author</a><br />
<a href="http://wikis.sun.com/display/chosug/OpenSolaris+2009.06+on+a+MacBook+Pro">http://wikis.sun.com/display/chosug/OpenSolaris+2009.06+on+a+MacBook+Pro</a></p>
<p>solaris,哈,同样经典的unix, 现在有opensolaris项目能够跑在x86体系上,看上面的链接就知道sun和apple的关系还是不错的,opensolaris有很好的官方支持macbook.所以希望了解solaris的童鞋不能错过了.我跟人对opensolaris也是一知半解就不多说了,不过感觉不错.</p>
<p>推荐值数: * * * *</p>
<p><span style="color: #ff0000;">mac上debian</span><br />
<a href="http://wiki.debian.org/MacBook">http://wiki.debian.org/MacBook</a><br />
debian,最古老,软件包最多,最自由,最有linux精神的发行版之一,是ubuntu他爹,同样对macbook支持不错,就是配置起来稍微geek点, 喜欢钻研系统的高手们,推荐使用.</p>
<p>推荐指数: * * * *</p>
<p><span style="color: #ff0000;">mac上gentoo</span><br />
<a href="http://www.odi.ch/prog/macbookpro/index.php">http://www.odi.ch/prog/macbookpro/index.php</a><br />
gentoo,包管理系统借鉴bsd的port, 全部源码自编译, 高手以及时间充裕的人,我相信一定能做出最适合自己,速度最快的linux. gentoo的意思是一种游的最快的企鹅.</p>
<p>推荐指数: * * *</p>
<p><span style="color: #ff0000;">mac上opensuse</span><br />
<a href="http://en.opensuse.org/Installation_on_MacBook">http://en.opensuse.org/Installation_on_MacBook</a><br />
opensuse, 华丽, 企业级高端应用, top500的超级计算机很多用的都是suse,这是为什么呢?我也不知道&#8230;想想华丽的suse配上精致的macbook一定感觉不错,但是文档支持一般, 软件支持也一般了.</p>
<p>推荐值数: * *</p>
<p><span style="color: #ff0000;">mac上arch linux</span><br />
<a href="http://wiki.archlinux.org/index.php/MacBook#Mac_OS_X_with_Arch_Linux">http://wiki.archlinux.org/index.php/MacBook#Mac_OS_X_with_Arch_Linux</a><br />
<a href="http://wiki.archlinux.org/index.php/MacBook_Aluminum">http://wiki.archlinux.org/index.php/MacBook_Aluminum</a><br />
<a href="http://wiki.archlinux.org/index.php/MacBookPro">http://wiki.archlinux.org/index.php/MacBookPro</a><br />
arch linux, 轻量级linux,可定制性高,对i686有特殊优化.　对mac支持还算不错,对于一般用户来说还是要费点事的.arch可能就是gentoo的折衷方案吧.</p>
<p>推荐指数: * * *</p>
<p><span style="color: #ff0000;">mac上fedora</span><br />
<a href="http://www.cenolan.com/2009/06/installing-fedora-11-on-a-macbook/">http://www.cenolan.com/2009/06/installing-fedora-11-on-a-macbook/</a><br />
fedora, redhat支持的开源发行版,那是相当的有实力,我也一直用.但是装在macbook上可能难度不亚于arch或者gentoo,连个官方文档都难找到.不过上面那个链接介绍的已经很清楚了,　喜欢fedora的童鞋别错过了,毕竟fedora还是一个非常不错的发行版.</p>
<p>推荐指数: * * *</p>
<p><span style="color: #ff0000;">mac上freebsd</span><br />
<a href="http://wiki.freebsd.org/AppleMacbook">http://wiki.freebsd.org/AppleMacbook</a><br />
freebsd, 和mac os x 同属一系. 优秀的架构,很适合作服务器应用, 让我想不到的是,对mac的支持也是相当的不错的,但是用起来还是需要一些经验和技术的,总之,freebsd装在mac上有些怪怪的,不过freebsd还是相当有内涵的OS大家不妨试试.</p>
<p>推荐指数: * * *</p>
<p>后记: 我们以前在pc上装hackintosh, 现在我们也在mac上装各种开源系统,这里我没有写安装过程,是因为,上面的链接里面已经讲的非常清楚了.写这个目的就是让人们知道,世界上不只有windows和mac os x, 还有许多优秀的系统, 在某些方面甚至更优秀.希望我们中国的开源事业能从OS开始, windows是个毒瘤, 把我们变的越来越傻, 我们越用越难以脱离, 我们就是这样被微软控制的.声明:没有说微软的技术不好, 只是它太封闭, 太独裁. 我们现在的版权意识很差,windows用的都是基本盗版的, 等到盗版不了的时候, 只有乖乖的交钱了. linux不仅免费,还能让我们更了解操作系统, 这样才是安全的.</p>

	标签：<a href="http://cyher.net/tag/apple" title="apple" rel="tag">apple</a>, <a href="http://cyher.net/tag/fedora" title="fedora" rel="tag">fedora</a>, <a href="http://cyher.net/tag/linux" title="linux" rel="tag">linux</a>, <a href="http://cyher.net/tag/mac-os-x" title="Mac OS X" rel="tag">Mac OS X</a>, <a href="http://cyher.net/tag/macbook" title="macbook" rel="tag">macbook</a>, <a href="http://cyher.net/tag/opensolaris" title="opensolaris" rel="tag">opensolaris</a>, <a href="http://cyher.net/tag/opensuse" title="opensuse" rel="tag">opensuse</a>, <a href="http://cyher.net/tag/ubuntu" title="ubuntu" rel="tag">ubuntu</a>, <a href="http://cyher.net/tag/unix" title="unix" rel="tag">unix</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://cyher.net/gnulinux/macbook-pro-ubuntu10-4-bcm-wireless-driver" title="macbook pro ubuntu10.4 bcm无线网卡问题修复 (2010年05月2号)">macbook pro ubuntu10.4 bcm无线网卡问题修复</a> (0)</li>
	<li><a href="http://cyher.net/apple/macos-x/sunpinyin" title="Mac OS X 上的开源输入法,SunPinyin. (2009年05月7号)">Mac OS X 上的开源输入法,SunPinyin.</a> (2)</li>
	<li><a href="http://cyher.net/apple/macos-x/technology_is_a_kind_of_belief_appl" title="科技是一种信仰(apple&#038;linux) (2009年01月12号)">科技是一种信仰(apple&#038;linux)</a> (5)</li>
	<li><a href="http://cyher.net/gnulinux/bad_cheese_linux" title="变质的奶酪,linux! (2009年01月18号)">变质的奶酪,linux!</a> (2)</li>
	<li><a href="http://cyher.net/gnulinux/unix-center" title="unix-center.net需要帮助 (2009年07月15号)">unix-center.net需要帮助</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://cyher.net/apple/multi-os-on-macbook/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>unix-center.net需要帮助</title>
		<link>http://cyher.net/gnulinux/unix-center</link>
		<comments>http://cyher.net/gnulinux/unix-center#comments</comments>
		<pubDate>Wed, 15 Jul 2009 07:53:20 +0000</pubDate>
		<dc:creator>cyher</dc:creator>
				<category><![CDATA[GNU/linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://cyher.net/?p=636966</guid>
		<description><![CDATA[我的邮件里有这么样子一封信http://www.unix-center.net/?p=133
看完以后，心中不知道有什么感觉，就去捐了100元。这时候有些人选择了，忽略，不信任，忘记等。。。确实这是一个自由的捐款，在自愿的情况下。但是我还是想帮助unix-center.net这个项目以及项目负责人，因为我收益于这个项目，我也知道，那些想学习linux或者unix的同学也一样，有些人有钱，有些人没钱，但是如果觉得这个项目帮助了自己或者能够帮助别人，那就请你出自己的一份力。因为在中国有这样的资源实属不多，所以我同项目负责人一样想让这个项目延续下去。说实话，这是我的一个个人信仰，也许也是这个项目负责人的信仰，帮助想要学习linux和unix系统的人。我现在只能做这些了，希望我们国家的开源和计算机事业都有源源不断的人材。
最后一句话，信任是不需要证据的，有了证据你再信任，信任就没有必要存在了。
&#8212;&#8211;送给那些不相信确有其事的人

	标签：linux, unix

	相关日志
	
	在macbook上安装各种操作系统 (0)
	Happy Hacking keyboard pro 2的艺术 (7)
	自己的嵌入式学习经验, 想不到别人给拍成视频了 (0)
	自己曾经作过的小实验 (0)
	科技是一种信仰(apple&#038;linux) (5)


]]></description>
			<content:encoded><![CDATA[<p>我的邮件里有这么样子一封信<a href="http://www.unix-center.net/?p=133" target="_blank">http://www.unix-center.net/?p=133</a></p>
<p>看完以后，心中不知道有什么感觉，就去捐了100元。这时候有些人选择了，忽略，不信任，忘记等。。。确实这是一个自由的捐款，在自愿的情况下。但是我还是想帮助unix-center.net这个项目以及项目负责人，因为我收益于这个项目，我也知道，那些想学习linux或者unix的同学也一样，有些人有钱，有些人没钱，但是如果觉得这个项目帮助了自己或者能够帮助别人，那就请你出自己的一份力。因为在中国有这样的资源实属不多，所以我同项目负责人一样想让这个项目延续下去。说实话，这是我的一个个人信仰，也许也是这个项目负责人的信仰，帮助想要学习linux和unix系统的人。我现在只能做这些了，希望我们国家的开源和计算机事业都有源源不断的人材。</p>
<p>最后一句话，信任是不需要证据的，有了证据你再信任，信任就没有必要存在了。<br />
&#8212;&#8211;送给那些不相信确有其事的人</p>

	标签：<a href="http://cyher.net/tag/linux" title="linux" rel="tag">linux</a>, <a href="http://cyher.net/tag/unix" title="unix" rel="tag">unix</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://cyher.net/apple/multi-os-on-macbook" title="在macbook上安装各种操作系统 (2009年07月26号)">在macbook上安装各种操作系统</a> (0)</li>
	<li><a href="http://cyher.net/peripherals/the-art-of-hhkb-pro-2" title="Happy Hacking keyboard pro 2的艺术 (2009年04月10号)">Happy Hacking keyboard pro 2的艺术</a> (7)</li>
	<li><a href="http://cyher.net/gnulinux/%e5%ad%a6%e4%b9%a0%e7%bb%8f%e9%aa%8c" title="自己的嵌入式学习经验, 想不到别人给拍成视频了 (2009年08月9号)">自己的嵌入式学习经验, 想不到别人给拍成视频了</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/%e8%87%aa%e5%b7%b1%e6%9b%be%e7%bb%8f%e4%bd%9c%e8%bf%87%e7%9a%84%e5%b0%8f%e5%ae%9e%e9%aa%8c" title="自己曾经作过的小实验 (2009年08月16号)">自己曾经作过的小实验</a> (0)</li>
	<li><a href="http://cyher.net/apple/macos-x/technology_is_a_kind_of_belief_appl" title="科技是一种信仰(apple&#038;linux) (2009年01月12号)">科技是一种信仰(apple&#038;linux)</a> (5)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://cyher.net/gnulinux/unix-center/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Hacking keyboard pro 2的艺术</title>
		<link>http://cyher.net/peripherals/the-art-of-hhkb-pro-2</link>
		<comments>http://cyher.net/peripherals/the-art-of-hhkb-pro-2#comments</comments>
		<pubDate>Fri, 10 Apr 2009 13:50:47 +0000</pubDate>
		<dc:creator>cyher</dc:creator>
				<category><![CDATA[Peripherals]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[hhkb]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://cyher.net/?p=636937</guid>
		<description><![CDATA[1.背景：
毕业以后我选择了程序员，而且是linux &#38; UNIX程序员。当在公司用一个极其不顺手，按一个键卡两个键的键盘之后我萌生了换键盘的想法。我就开始寻觅键盘的旅程。
至于为什么我对键盘或者鼠标有这么高的要求，这还要从我的第一台电脑说起。当我家人答应给我第一台电脑的时候，我就向我的一个很懂计算机的哥哥求援，让他帮我装一台电脑价格在5000左右，这台电脑装下来的结果就是，主机2000，电脑外设3000。我也不懂啊，我就问他这是为什么啊，人家机子性能都那么好我的看上去不行啊。那位哥哥（他也是程序员）就说了，我觉得一个个人电脑最重要的地方就是与人有直接接触的地方，无外乎鼠标，键盘，显示器，音箱耳机，等输入输出设备。我当时也不明白，但是就有一个感觉，我家的电脑超级好用，屏幕色彩艳丽（当时最好的sony特丽珑显像管），当时我已经在用logitech的鼠标和键盘了。
到现在已经8年过去了，我也成为了一个程序员，我对外设的要求就更高了，logitech的键鼠已经不能满足我的要求，在我苦苦寻觅的时候有一张照片进入了我的视线：



他就是Richard stallman，不知道的人可以google一下，不知道的Windows程序员我不怪你，不知道的linux或者用着freesoftware的程序员我不知道说啥好了。看见他用的键盘没有，就是HHKB pro，有人戏称他用的键盘要比他用的笔记本还贵（他的那个笔记本是100美元笔记本计划的产物）。就这样我就疯狂的找他的这款键盘，当然功夫不负有心人，找到了咱们坛子。然后就找到很多相关介绍，然后就。。。在混沌那里入了。所以说我对HHKB有特别的感情，和大家不是很一样了，我喜欢的是HHKB的layout和名字，手感当然很重要，要不我也不会花那么多米整个键盘。
2. 键盘参数介绍
这个我想就不用我多介绍了，毕竟复制别人东西也不是很好，
http://en.wikipedia.org/wiki/Happy_Hacking_Keyboard
这个链接里面讲的也很清楚了，具体细节在这个页面下的References标签后面，总之很全面了
3.外观，用料，手感
这个想必是对这种高档键盘非常关心的了。我以一个新手的态度主观评价，大家听听便是，切勿妄信，后果自负。
外观　(我的桌面,自爆一下)




这个由几个图来解释吧，我多说无益。我个人觉得外观还是给你很清爽的感觉，有一点cool在里面，别的没有什么出彩之处，没有led灯，仅仅只有60个键，（这个我要说两句，我觉得挺好的，电路和程序这两种东西都是simple is the best！很简单，功能结点越少，故障点也也越少，那不就意味着故障越少么。所以我喜欢简单高效的东西）。小巧的外观,出色的便携性和多系统的适用性,绝对是一般键盘不能比拟的.
用料和手感：
1.键帽材质就是大家熟知的PBT,黑同的键帽是热升华（含浸印刷）字体和键帽融为一体，手摸在上面是一个平面。键帽相对ABS键帽的手感较硬，没有那么多任性和缓冲在里面，键面的手感是磨砂手感，同样因为比较硬，并不是一些键盘的肤质手感。（主观的说，我感觉ABS键帽的手感更好，因为ABS对我来说是暖性的，手感容易出来也就是键盘和手能够融为一体，PBT键帽给我凉凉的感觉，也许是我没有适应，但是我感觉硬朗的触摸感更能提高打字速度）。当然论质量和耐久度的话，PBT绝对一流。
还请大家看看这图,不知道是这人牛逼,还是&#8230;.所以大家别迷信PBT材料,该打油的时候照样打,就是时间问题

2.按键按下的段落感比茶轴要好和青轴有点像。但是比青轴好，为什么呢？手感上说就是，按键压力比较一致，就是不管你按多深压力都差不多，cherry青轴就不同，当你按到最下面的时候，压力就变大些，这样对我来说感觉不是很畅快。想想一下，这个曲线,压力的斜率是保持不变的,一直上升(这个图是红轴的)：


我还是比较喜欢有段落感，并且段落感之后的下压力最好能保持一致，让我能很轻松的完成敲击，用一句话描述这种感觉就是，冲破阻力后，立即轻松有很鲜明对比的感觉。现在我知道的类似这种手感的键盘有：8115（薄膜） 和 hhkb pro2。既然8115 和 hhkb pro2都是这样的手感，那他们有什么不同呢？8115的键帽活动度很大，给你有点散架个感觉，hhkb pro2 做工就很精细。HHKB的回弹很爽,但是8115就是比较慢了,形象点说就是有点肉了,当你火力全开的时候你就能感觉回弹的作用了,真正的帮助你键指如飞.
3.键盘的人体工学，就是那个阶梯分布，这个我非常喜欢，因为hhkb pro的阶梯分布比一般键盘明显，对我来说按键更加省力，找键更加快速。但是有个缺点就是HHKB pro和桌面有一个2厘米左右的落差，让我感觉很是不爽，垫本书就要好的多了，看来我需要手托了。
键盘布局，功能：

这个是最有争议的地方，惹的大多数人都去realforce帮了，但是我要说的是，realforce的手感和素质是和HHKB相当的，或许还要好，但是要和HHKB比功能的话，rf简直太普通(不过rf86/87好像也有contrl和caps lock对换的功能）。还是那句话，如果非要把realforce和HHKB pro 做比较的话，realforce的素质仅仅是HHKB的开始。下面我来说为什么。看见这个键盘布局图以后大家会发现什么，ESC的位置，control的位置，backspace（Delete）的位置，alt的位置和正常的104键的layout很不同？ 那好你在看看这个键盘layout


这些都是sun 的键盘layout，是不是和hhkb有点像了啊
ok再看一个：


这个是苹果最新的g6键盘 铝制机身，做工超棒，手感在超薄薄膜里面和IBM的笔记本键盘能打个平手，但是致命缺点它是超薄的，所以我出了换hhkb了着两个的layout是不是也有点接近,看 左右atl键的位置和咱们普通键盘的alt位置是不以样的。
说一点背景知识，

现在sun的Solaris被认为是最纯正的UNIX，apple的MAC OS X也通过了unix的认证，所以说着两个系统都是符合UNIX规范的.

对大部分人来说，IBM的经典101键是最标准的，但是对我来说，最标准的键盘现在能找到的也就是HHKB了。所以所大家对HHKB不满也是有原因的，我入手HHKB同样也是有原因的。用途不一样需求造就不一样的产品，对于UNIX程序员来说HHKB绝对是完美的。UNIX程序员只有键盘以及快捷键的设置都遵循一个标准：“手移动最少的距离，作更多的操作”.
下面来看下HHKB在linux和unix命令行中的表现，首先介绍几个快捷键ctrl-n = 下, ctrl-b = 左,ctrl-f = 右,ctrl-p = 上, ctrl &#8211; j = 回车,ctrl-H=退格，这几个是通用的在所有的类unix的终端上都可以用，有心人你可以试试，如果你的ctrl键是标准101的layout，你可以多按几次，看看你的小手指头酸了没，然后把caps lock当成ctrl再试试呢？是不是很顺畅？人家unix本来就是照这个键位设计的&#8230;用IBM的101布局当然不爽了.
对于我个人而言除了在命令行中工作,最多的就是在vim中了(vim和Emacs是unix中乃至所有计算机系统中最强大的两个编辑器,Emacs更强,有兴趣可以google).先说vim:

看看图中都用到了哪些键?是不是根本没有F区,j,k,h,l分别对应上,下,左,右,i和esc是模式切换键同时也有很多control键组合出的快捷键.这些特点结合HHKB pro2 的layout,是不是有一种霍然开朗的感觉?这难倒是为vim定制的键盘? esc离主键区的距离正好能让我的小指够到而不需要吧食指离开F键使我的操作效率提升很多(因为vim经常要在模式中切换),control的位置让我长时间用这些组合键的时候,不会再小指头抽筋了,省去了没用的F区,让我的桌面更宽松(说实话我现在还不知道几个linux中和F区键有关的快捷键),没有方向键?我根本用不到&#8230;要说Emacs,我本人不是很常用但是我知道一点就是,Emacs中所有的功能实现都要配合control键,想想吧,上下左右要是都用ctrl,有几个人的小拇指能受的了,还好有人发明了手掌按ctrl大法这样真实缓解不少,但是哪有HHKB这种键位自然&#8230;
对于Emacs我这还有一个小插曲

Emacs是一种信仰,世界最强编辑器
http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/865628.html
这个世界最强是个怎么样的强法呢？一说：Emacs是一种“信仰”。另说：世界上的程序员分三种，一种使用Emacs，一种使用vim，剩余的是其它。（完全无视其他编辑器的存在……）
Emacs就是上面提到的Richard Stallman开发维护的,世界上最强的编辑器是免费的....
Emacs 是一个很有意思缩写 Escape Meta Alt Control Shift, 呵呵没什么说的了把, HHKB是最适合Emacs不过的了.(Meta键就是windows上的win键)

上面说的都是我工作中的需求,在娱乐的时候呢,我在家用mac的笔记本,HHKB有macnitosh模式,直接切换,然后我就能有mac下面独特的多媒体键,声音大小阿,关机,弹出光盘等,还有mac系统的所有快捷键都可以用,总之和mac系统配合的是很不错的,如果说你用windows是你入手rrealforce而不选择HHKB的理由的话,我就没有任何理由了&#8230;&#8230;
我在mac上也不怎么玩游戏,只玩一种,war3. [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: medium;">1.背景：<br />
毕业以后我选择了程序员，而且是linux &amp; UNIX程序员。当在公司用一个极其不顺手，按一个键卡两个键的键盘之后我萌生了换键盘的想法。我就开始寻觅键盘的旅程。<br />
至于为什么我对键盘或者鼠标有这么高的要求，这还要从我的第一台电脑说起。当我家人答应给我第一台电脑的时候，我就向我的一个很懂计算机的哥哥求援，让他帮我装一台电脑价格在5000左右，这台电脑装下来的结果就是，主机2000，电脑外设3000。我也不懂啊，我就问他这是为什么啊，人家机子性能都那么好我的看上去不行啊。那位哥哥（他也是程序员）就说了，我觉得一个个人电脑最重要的地方就是与人有直接接触的地方，无外乎鼠标，键盘，显示器，音箱耳机，等输入输出设备。我当时也不明白，但是就有一个感觉，我家的电脑超级好用，屏幕色彩艳丽（当时最好的sony特丽珑显像管），当时我已经在用logitech的鼠标和键盘了。<br />
到现在已经8年过去了，我也成为了一个程序员，我对外设的要求就更高了，logitech的键鼠已经不能满足我的要求，在我苦苦寻觅的时候有一张照片进入了我的视线：</span></p>
<p align="center"><a href="http://www.lupaworld.com/attachments/2008/05/22802_2008052909584117.jpg" rel="lightbox[636937]"><img style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://www.lupaworld.com/attachments/2008/05/22802_2008052909584117.jpg" border="0" alt="" width="800" height="727" /></a></p>
<p align="center"><a href="http://bbs.chinaunix.net/attachments/month_0805/20080528_9cf29d1ba2db27e086c6xcR67Ybx3EnX.jpg" rel="lightbox[636937]"><img style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://bbs.chinaunix.net/attachments/month_0805/20080528_9cf29d1ba2db27e086c6xcR67Ybx3EnX.jpg" border="0" alt="" width="600" height="475" /></a></p>
<p style="text-align: center; " align="center"><a href="http://www.lugos.si/lugos/rms2000/pic/RMS-2000-10-13/pic00001.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://www.lugos.si/lugos/rms2000/pic/RMS-2000-10-13/pic00001.jpg" border="0" alt="" width="1280" height="1024" /></a></p>
<p>他就是Richard stallman，不知道的人可以google一下，不知道的Windows程序员我不怪你，不知道的linux或者用着freesoftware的程序员我不知道说啥好了。看见他用的键盘没有，就是HHKB pro，有人戏称他用的键盘要比他用的笔记本还贵（他的那个笔记本是100美元笔记本计划的产物）。就这样我就疯狂的找他的这款键盘，当然功夫不负有心人，找到了咱们坛子。然后就找到很多相关介绍，然后就。。。在混沌那里入了。所以说我对HHKB有特别的感情，和大家不是很一样了，我喜欢的是HHKB的layout和名字，手感当然很重要，要不我也不会花那么多米整个键盘。</p>
<p>2. 键盘参数介绍<br />
这个我想就不用我多介绍了，毕竟复制别人东西也不是很好，<br />
<a href="http://en.wikipedia.org/wiki/Happy_Hacking_Keyboard" target="_blank">http://en.wikipedia.org/wiki/Happy_Hacking_Keyboard</a><br />
这个链接里面讲的也很清楚了，具体细节在这个页面下的References标签后面，总之很全面了</p>
<p>3.外观，用料，手感<br />
这个想必是对这种高档键盘非常关心的了。我以一个新手的态度主观评价，大家听听便是，切勿妄信，后果自负。<br />
外观　(我的桌面,自爆一下)</p>
<p style="text-align: center; " align="center"><a href="http://lh3.ggpht.com/_QDIGAdAEoJM/SdtLSamO07I/AAAAAAAABZo/BfhBvAtDZO4/s800/DSCN3324.JPG" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://lh3.ggpht.com/_QDIGAdAEoJM/SdtLSamO07I/AAAAAAAABZo/BfhBvAtDZO4/s800/DSCN3324.JPG" border="0" alt="" width="800" height="600" /></a></p>
<p style="text-align: center; "><a href="http://lh5.ggpht.com/_QDIGAdAEoJM/SdtLWS6IBKI/AAAAAAAABZs/CZAFlBwYNYo/s800/DSCN3323.JPG" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://lh5.ggpht.com/_QDIGAdAEoJM/SdtLWS6IBKI/AAAAAAAABZs/CZAFlBwYNYo/s800/DSCN3323.JPG" border="0" alt="" width="800" height="600" /></a></p>
<p style="text-align: center; "><a href="http://lh6.ggpht.com/_QDIGAdAEoJM/SdtLGgvMFQI/AAAAAAAABZY/do7b8EMJsT8/s800/DSCN3325.JPG" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://lh6.ggpht.com/_QDIGAdAEoJM/SdtLGgvMFQI/AAAAAAAABZY/do7b8EMJsT8/s800/DSCN3325.JPG" border="0" alt="" width="800" height="600" /></a></p>
<p style="text-align: center; "><a href="http://lh4.ggpht.com/_QDIGAdAEoJM/SdtLN0aF9KI/AAAAAAAABZk/WBW4a2D4Wcc/s800/DSCN3320.JPG" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://lh4.ggpht.com/_QDIGAdAEoJM/SdtLN0aF9KI/AAAAAAAABZk/WBW4a2D4Wcc/s800/DSCN3320.JPG" border="0" alt="" width="800" height="600" /></a></p>
<p>这个由几个图来解释吧，我多说无益。我个人觉得外观还是给你很清爽的感觉，有一点cool在里面，别的没有什么出彩之处，没有led灯，仅仅只有60个键，（这个我要说两句，我觉得挺好的，电路和程序这两种东西都是simple is the best！很简单，功能结点越少，故障点也也越少，那不就意味着故障越少么。所以我喜欢简单高效的东西）。小巧的外观,出色的便携性和多系统的适用性,绝对是一般键盘不能比拟的.</p>
<p>用料和手感：<br />
1.键帽材质就是大家熟知的PBT,黑同的键帽是热升华（含浸印刷）字体和键帽融为一体，手摸在上面是一个平面。键帽相对ABS键帽的手感较硬，没有那么多任性和缓冲在里面，键面的手感是磨砂手感，同样因为比较硬，并不是一些键盘的肤质手感。（主观的说，我感觉ABS键帽的手感更好，因为ABS对我来说是暖性的，手感容易出来也就是键盘和手能够融为一体，PBT键帽给我凉凉的感觉，也许是我没有适应，但是我感觉硬朗的触摸感更能提高打字速度）。当然论质量和耐久度的话，PBT绝对一流。<br />
还请大家看看这图,不知道是这人牛逼,还是&#8230;.所以大家别迷信PBT材料,该打油的时候照样打,就是时间问题</p>
<p style="text-align: center; " align="center"><a href="http://farm4.static.flickr.com/3614/3420280973_4a3d775514_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3614/3420280973_4a3d775514_o.jpg" border="0" alt="" width="1024" height="768" /></a></p>
<p>2.按键按下的段落感比茶轴要好和青轴有点像。但是比青轴好，为什么呢？手感上说就是，按键压力比较一致，就是不管你按多深压力都差不多，cherry青轴就不同，当你按到最下面的时候，压力就变大些，这样对我来说感觉不是很畅快。想想一下，这个曲线,压力的斜率是保持不变的,一直上升(这个图是红轴的)：</p>
<p align="center"><a href="http://img3.pconline.com.cn/pconline/0903/06/1583220_cherry-zy090306-3_mthumb.jpg" rel="lightbox[636937]"><img style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://img.article.pchome.net/00/38/24/24/hchong.jpg" border="0" alt="" width="500" height="719" /></a><br />
<a href="http://www.pcshow.net/images/article/0706/222556-10"><img style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://www.pcshow.net/images/article/0706/222556-10" border="0" alt="" width="468" height="215" /></a></p>
<p>我还是比较喜欢有段落感，并且段落感之后的下压力最好能保持一致，让我能很轻松的完成敲击，用一句话描述这种感觉就是，冲破阻力后，立即轻松有很鲜明对比的感觉。现在我知道的类似这种手感的键盘有：8115（薄膜） 和 hhkb pro2。既然8115 和 hhkb pro2都是这样的手感，那他们有什么不同呢？8115的键帽活动度很大，给你有点散架个感觉，hhkb pro2 做工就很精细。HHKB的回弹很爽,但是8115就是比较慢了,形象点说就是有点肉了,当你火力全开的时候你就能感觉回弹的作用了,真正的帮助你键指如飞.<br />
3.键盘的人体工学，就是那个阶梯分布，这个我非常喜欢，因为hhkb pro的阶梯分布比一般键盘明显，对我来说按键更加省力，找键更加快速。但是有个缺点就是HHKB pro和桌面有一个2厘米左右的落差，让我感觉很是不爽，垫本书就要好的多了，看来我需要手托了。</p>
<p>键盘布局，功能：</p>
<p align="center"><a href="http://www.pfu.fujitsu.com/hhkeyboard/leaflet/images/pro2nl_sumi_a_l.jpg" rel="lightbox[636937]"><img style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://www.pfu.fujitsu.com/hhkeyboard/leaflet/images/pro2nl_sumi_a_l.jpg" border="0" alt="" width="873" height="457" /></a></p>
<p>这个是最有争议的地方，惹的大多数人都去realforce帮了，但是我要说的是，realforce的手感和素质是和HHKB相当的，或许还要好，但是要和HHKB比功能的话，rf简直太普通(不过rf86/87好像也有contrl和caps lock对换的功能）。还是那句话，如果非要把realforce和HHKB pro 做比较的话，realforce的素质仅仅是HHKB的开始。下面我来说为什么。看见这个键盘布局图以后大家会发现什么，ESC的位置，control的位置，backspace（Delete）的位置，alt的位置和正常的104键的layout很不同？ 那好你在看看这个键盘layout</p>
<p align="center"><a href="http://www.sunshack.org/data/sunpix/type5_kb.jpg" rel="lightbox[636937]"><img style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://www.sunshack.org/data/sunpix/type5_kb.jpg" border="0" alt="" width="879" height="607" /></a></p>
<p style="text-align: center; "><a href="http://www.sunshack.org/data/sunpix/type4_kb+mouse.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://www.sunshack.org/data/sunpix/type4_kb+mouse.jpg" border="0" alt="" width="568" height="301" /></a></p>
<p>这些都是sun 的键盘layout，是不是和hhkb有点像了啊</p>
<p>ok再看一个：</p>
<p style="text-align: center; "><a href="http://farm4.static.flickr.com/3566/3401358895_cdd6476d91_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3566/3401358895_cdd6476d91_o.jpg" border="0" alt="" width="1024" height="768" /></a></p>
<p style="text-align: center; " align="center"><a href="http://farm4.static.flickr.com/3458/3402164692_57cb4e8db5_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3458/3402164692_57cb4e8db5_o.jpg" border="0" alt="" width="1024" height="768" /></a></p>
<p>这个是苹果最新的g6键盘 铝制机身，做工超棒，手感在超薄薄膜里面和IBM的笔记本键盘能打个平手，但是致命缺点它是超薄的，所以我出了换hhkb了着两个的layout是不是也有点接近,看 左右atl键的位置和咱们普通键盘的alt位置是不以样的。<br />
说一点背景知识，</p>
<div class="blockcode">
<blockquote><p><code id="code0">现在sun的Solaris被认为是最纯正的UNIX，apple的MAC OS X也通过了unix的认证，所以说着两个系统都是符合UNIX规范的.</code></p></blockquote>
</div>
<p>对大部分人来说，IBM的经典101键是最标准的，但是对我来说，最标准的键盘现在能找到的也就是HHKB了。所以所大家对HHKB不满也是有原因的，我入手HHKB同样也是有原因的。用途不一样需求造就不一样的产品，对于UNIX程序员来说HHKB绝对是完美的。UNIX程序员只有键盘以及快捷键的设置都遵循一个标准：“手移动最少的距离，作更多的操作”.<br />
下面来看下HHKB在linux和unix命令行中的表现，首先介绍几个快捷键ctrl-n = 下, ctrl-b = 左,ctrl-f = 右,ctrl-p = 上, ctrl &#8211; j = 回车,ctrl-H=退格，这几个是通用的在所有的类unix的终端上都可以用，有心人你可以试试，如果你的ctrl键是标准101的layout，你可以多按几次，看看你的小手指头酸了没，然后把caps lock当成ctrl再试试呢？是不是很顺畅？人家unix本来就是照这个键位设计的&#8230;用IBM的101布局当然不爽了.</p>
<p>对于我个人而言除了在命令行中工作,最多的就是在vim中了(vim和Emacs是unix中乃至所有计算机系统中最强大的两个编辑器,Emacs更强,有兴趣可以google).先说vim:</p>
<p style="text-align: center; " align="center"><a href="http://www.ohlinux.com/wp-content/uploads/2009/02/vivim_vim.png" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://www.ohlinux.com/wp-content/uploads/2009/02/vivim_vim.png" border="0" alt="" width="1127" height="798" /></a></p>
<p>看看图中都用到了哪些键?是不是根本没有F区,j,k,h,l分别对应上,下,左,右,i和esc是模式切换键同时也有很多control键组合出的快捷键.这些特点结合HHKB pro2 的layout,是不是有一种霍然开朗的感觉?这难倒是为vim定制的键盘? esc离主键区的距离正好能让我的小指够到而不需要吧食指离开F键使我的操作效率提升很多(因为vim经常要在模式中切换),control的位置让我长时间用这些组合键的时候,不会再小指头抽筋了,省去了没用的F区,让我的桌面更宽松(说实话我现在还不知道几个linux中和F区键有关的快捷键),没有方向键?我根本用不到&#8230;要说Emacs,我本人不是很常用但是我知道一点就是,Emacs中所有的功能实现都要配合control键,想想吧,上下左右要是都用ctrl,有几个人的小拇指能受的了,还好有人发明了手掌按ctrl大法这样真实缓解不少,但是哪有HHKB这种键位自然&#8230;<br />
对于Emacs我这还有一个小插曲</p>
<blockquote>
<div class="blockcode"><code id="code1">Emacs是一种信仰,世界最强编辑器</p>
<p>http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/865628.html</p>
<p>这个世界最强是个怎么样的强法呢？一说：Emacs是一种“信仰”。另说：世界上的程序员分三种，一种使用Emacs，一种使用vim，剩余的是其它。（完全无视其他编辑器的存在……）<br />
Emacs就是上面提到的Richard Stallman开发维护的,世界上最强的编辑器是免费的....<br />
Emacs 是一个很有意思缩写 Escape Meta Alt Control Shift, 呵呵没什么说的了把, HHKB是最适合Emacs不过的了.(Meta键就是windows上的win键)</code></div>
</blockquote>
<p>上面说的都是我工作中的需求,在娱乐的时候呢,我在家用mac的笔记本,HHKB有macnitosh模式,直接切换,然后我就能有mac下面独特的多媒体键,声音大小阿,关机,弹出光盘等,还有mac系统的所有快捷键都可以用,总之和mac系统配合的是很不错的,如果说你用windows是你入手rrealforce而不选择HHKB的理由的话,我就没有任何理由了&#8230;&#8230;<br />
我在mac上也不怎么玩游戏,只玩一种,war3. 当然这个键盘的手感和layout就是不是很合适了.就不多说了.看来每个键盘都有它适合的人和地方. HHKB适合长期键入文字,尤其适合unix系统的管理员和程序员,如果你是mac用户的话也同样适合.如果是游戏或者windows的话我觉得HHKB不是一个最好的选择.</p>
<p>4.happy hacking的来历<br />
happy hacking 本来是 Emacs的一个标语 ，也是stallman本人的信条<br />
大家可以看这里 有个T-shirt 就是happy hacking<br />
<a href="http://shop.fsf.org/product/happy-hacking-shirt/" target="_blank">http://shop.fsf.org/product/happy-hacking-shirt/</a></p>
<p style="text-align: center;"><a href="http://shop.fsf.org/product/happy-hacking-shirt/" target="_blank"></a><br />
<a href="http://shop.fsf.org/static/images/productimage-picture-happy-hacking-shirt-15_t280.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://shop.fsf.org/static/images/productimage-picture-happy-hacking-shirt-15_t280.jpg" border="0" alt="" width="280" height="328" /></a><br />
<a href="http://shop.fsf.org/static/images/productimage-picture-happy-hacking-shirt-16_t280.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://shop.fsf.org/static/images/productimage-picture-happy-hacking-shirt-16_t280.jpg" border="0" alt="" width="280" height="343" /></a></p>
<p>这个背后的标志就是Emacs的标志</p>
<p><a href="http://terse.yo2.cn/articles/rms%E6%B8%85%E5%8D%8E%E8%A1%8C.html" target="_blank">http://terse.yo2.cn/articles/rms清华行.html</a> 有兴趣的可以看这里<br />
5.DIP开关:<br />
这个我专门翻译了一篇linuxjoury的文章,<br />
<a href="http://cyher.net/peripherals/happy-hacking-keyboard-professional-review">Happy Hacking Keyboard Professional Review</a></p>
<p>后记:<br />
HHKB绝对是一款经典的产品,就因为他的经典国外有好多geek都喜欢mod HHKB,下面就是一些图赏:</p>
<p align="center"><a href="http://farm4.static.flickr.com/3345/3421073412_b81bd06134_o.jpg" rel="lightbox[636937]"><img style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3345/3421073412_b81bd06134_o.jpg" border="0" alt="" width="640" height="384" /></a></p>
<p style="text-align: center;"><a href="http://farm4.static.flickr.com/3295/3421077062_e1818dbc07_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3295/3421077062_e1818dbc07_o.jpg" border="0" alt="" width="640" height="480" /></a></p>
<p style="text-align: center;"><a href="http://farm4.static.flickr.com/3625/3421062662_57769cd92a_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3625/3421062662_57769cd92a_o.jpg" border="0" alt="" width="1024" height="768" /></a></p>
<p style="text-align: center;"><a href="http://farm4.static.flickr.com/3404/3421029818_c1ecb15b22_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3404/3421029818_c1ecb15b22_o.jpg" border="0" alt="" width="500" height="270" /></a></p>
<p style="text-align: center;"><a href="http://farm4.static.flickr.com/3648/3421064172_46a811e8f4_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3648/3421064172_46a811e8f4_o.jpg" border="0" alt="" width="1024" height="681" /></a></p>
<p style="text-align: center;"><a href="http://farm4.static.flickr.com/3305/3421087134_06447b0982_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3305/3421087134_06447b0982_o.jpg" border="0" alt="" width="320" height="240" /></a></p>
<p style="text-align: center;"><a href="http://farm4.static.flickr.com/3593/3420235973_060526456b_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3593/3420235973_060526456b_o.jpg" border="0" alt="" width="1024" height="768" /></a></p>
<p><a href="http://farm4.static.flickr.com/3561/3420238181_9eab8f0103_o.jpg" rel="lightbox[636937]"><img class="alignnone" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3561/3420238181_9eab8f0103_o.jpg" border="0" alt="" width="1024" height="768" /></a></p>
<p style="text-align: center;"><a href="http://farm4.static.flickr.com/3403/3420238417_9d3b5367f0_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3403/3420238417_9d3b5367f0_o.jpg" border="0" alt="" width="1024" height="768" /></a></p>
<p style="text-align: center;"><a href="http://farm4.static.flickr.com/3338/3421087592_43d1f25a27_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3338/3421087592_43d1f25a27_o.jpg" border="0" alt="" width="683" height="1024" /></a></p>
<p style="text-align: center;"><a href="http://farm4.static.flickr.com/3249/3420251263_2a18bfeef1_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3249/3420251263_2a18bfeef1_o.jpg" border="0" alt="" width="1024" height="768" /></a></p>
<p style="text-align: center;"><a href="http://farm4.static.flickr.com/3384/3420252419_0de89e7551_o.jpg" rel="lightbox[636937]"><img class="aligncenter" style="border: 0px initial initial;" onclick="zoom(this, this.src)" src="http://farm4.static.flickr.com/3384/3420252419_0de89e7551_o.jpg" border="0" alt="" width="640" height="480" /></a></p>
<p>HHKB对于我来说,不仅仅是一个键盘那么简单,他小巧的身躯里散发这UNIX的精髓,可以说算是一种信仰吧.</p>

	标签：<a href="http://cyher.net/tag/emacs" title="emacs" rel="tag">emacs</a>, <a href="http://cyher.net/tag/hhkb" title="hhkb" rel="tag">hhkb</a>, <a href="http://cyher.net/tag/keyboard" title="keyboard" rel="tag">keyboard</a>, <a href="http://cyher.net/tag/linux" title="linux" rel="tag">linux</a>, <a href="http://cyher.net/tag/mac-os" title="Mac OS" rel="tag">Mac OS</a>, <a href="http://cyher.net/tag/unix" title="unix" rel="tag">unix</a>, <a href="http://cyher.net/tag/vim" title="vim" rel="tag">vim</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://cyher.net/peripherals/happy-hacking-keyboard-professional-review" title="Happy Hacking Keyboard Professional Review(中文翻译) (2009年04月8号)">Happy Hacking Keyboard Professional Review(中文翻译)</a> (3)</li>
	<li><a href="http://cyher.net/apple/macos-x/technology_is_a_kind_of_belief_appl" title="科技是一种信仰(apple&#038;linux) (2009年01月12号)">科技是一种信仰(apple&#038;linux)</a> (5)</li>
	<li><a href="http://cyher.net/apple/multi-os-on-macbook" title="在macbook上安装各种操作系统 (2009年07月26号)">在macbook上安装各种操作系统</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/unix-center" title="unix-center.net需要帮助 (2009年07月15号)">unix-center.net需要帮助</a> (0)</li>
	<li><a href="http://cyher.net/gnulinux/%e5%ad%a6%e4%b9%a0%e7%bb%8f%e9%aa%8c" title="自己的嵌入式学习经验, 想不到别人给拍成视频了 (2009年08月9号)">自己的嵌入式学习经验, 想不到别人给拍成视频了</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://cyher.net/peripherals/the-art-of-hhkb-pro-2/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
