[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

fbvnc running on SL-C1000



On Mon, Jul 25, 2005 at 11:01:52AM -0500, Klaus Weidner wrote:
> Currently you'd need to change it in the source code (the keyboard.c
> "fbvnc_keymap_c700" table), the key map is hardcoded.  I'm thinking about
> supporting a loadable key map but that wasn't high on my priority list so
> far. 
Messing with the fbvnc code wasn't very high on my list of priorities
either until I killed another C750 and decided to replace it with a C1000
this time.
After reading what was hacked into fbvnc 1.4 for the C3000 at
http://www.tcp-ip.or.jp/~naorou/linuzau/fbvnc.html and a night and a day
of highly interupted hacking on the 1.7.1 source I am happy to say my
C1000 is running debian off the SD card that I just transfered over from
my 750.  Amazingly enough the backlight levels and suspend/resume seem
to work just fine.

Attached is my first patch file, so forgive me if it doesn't work out of
the box.  I laid out my keymap as similarly as possible to Klaus's
original C700 mappings rather than the alternate mapping linked above.
Because of the dedicated Ctrl key and wanting a "meta" key for ratpoison
I mapped the kana key to Alt_L and the kanji key to Insert (an arbitrary
unused key).

I played a bit with getting my menu key to be an alternate Fn or action
key but set that aside until I had at least the basics working.  The
basic keymapping could be seperated out of the code base fairly easily
but there are a lot of places that handle all the special magic related
to Fn/action keys that it will not be straight forward or else I would
have just done it.

FYI: If you are building fbvnc on a Zaurus running debian and you've
upgraded glibc you might want to build a static binary.

I'm off to get used to the slightly different feel and key placements!
Enjoy.

-- 
Wayne Buckhanan        	                               wayne@mercs.net
What usually happens in the educational process is that the faculties
are dulled, overloaded, stuffed and paralyzed, so that by the time
that most people are mature they have lost use of many of their innate
capabilities.       --R. Buckminster Fuller, Education Automation 1962
*** fbvnc/keyboard.c	Thu Jul 22 11:21:53 2004
--- fbvnc-WLB/keyboard.c	Thu Feb 23 22:48:19 2006
***************
*** 443,448 ****
--- 443,591 ----
  	29, 0 /*122*/,
  };
  
+ static int fbvnc_keymap_c1000[N_SCANCODE*4] = {
+ 	0, 0, 0, 0,				/* 0 */
+ 	XK_a, XK_A, XK_adiaeresis, XK_Adiaeresis,
+ 	XK_b, XK_B, XK_underscore, 0,
+ 	XK_c, XK_C, 0, 0,
+ 	XK_d, XK_D, XK_grave, 0,
+ 	XK_e, XK_E, XK_equal, 0,	
+ 	XK_f, XK_F, XK_backslash, 0,
+ 	XK_g, XK_G, XK_semicolon, 0,
+ 	XK_h, XK_H, XK_colon, 0,
+ 	XK_i, XK_I, XK_braceright, 0,
+ 	XK_j, XK_J, XK_asterisk, 0,
+ 	XK_k, XK_K, 0, 0,
+ 	XK_l, XK_L, XK_bar, 0,
+ 	XK_m, XK_M, 0, 0,
+ 	XK_n, XK_N, 0, 0,
+ 	XK_o, XK_O, XK_odiaeresis, XK_Odiaeresis,
+ 	XK_p, XK_P, XK_udiaeresis, XK_Udiaeresis,
+ 		/* should be on "u" key, but that's labeled as brackets */	
+ 	XK_q, XK_Q, 0, 0,	
+ 	XK_r, XK_R, XK_plus, 0,	
+ 	XK_s, XK_S, XK_ssharp, 0,
+ 	XK_t, XK_T, XK_bracketleft, 0,
+ 	XK_u, XK_U, XK_braceleft, 0,
+ 	XK_v, XK_V, 0, 0,
+ 	XK_w, XK_W, XK_asciicircum, 0,
+ 	XK_x, XK_X, 0, 0,
+ 	XK_y, XK_Y, XK_bracketright, 0,
+ 	XK_z, XK_Z, 0, 0,			/* 26 */
+ 	XK_Shift_L, 0, 0, 0,
+ 	XK_Return, 0, XK_Scroll_Lock, 0,
+ 	0 /* menu */, 0, 0, 0,
+ 	0 /* Fn = XK_Alt_R */, 0, 0, 0,		/* 30 */
+ 	XK_BackSpace, 0, XK_Delete, 0,
+ 	XK_bar /* Fn-Space */, XK_backslash, 0, 0,
+ 	0, 0, 0, 0,
+ 	XK_Escape /* cancel =34 */, 0, 0, 0,
+ 	XK_Left, 0, 0, 0,
+ 	XK_Up, 0, 0, 0,
+ 	XK_Down, 0, 0, 0,
+ 	XK_Right, 0, 0, 0,
+ 	XK_Return /* OK =39*/, 0, 0, 0,
+ 	XK_End /* XK_Home */, 0, 0, 0,				/* 40 */
+ 	XK_1, XK_exclam, XK_F1, 0,
+ 	XK_2, XK_quotedbl, XK_F2, 0,
+ 	XK_3, XK_numbersign, XK_F3, 0,
+ 	XK_4, XK_dollar, XK_F4, 0,
+ 	XK_5, XK_percent, XK_F5, 0,
+ 	XK_6, XK_ampersand, XK_F6, 0,
+ 	XK_7, XK_apostrophe, XK_F7, 0,
+ 	XK_8, XK_parenleft, XK_F8, 0,
+ 	XK_9, XK_parenright, XK_F9, 0,
+ 	XK_0, XK_asciitilde, XK_F10, 0,				/* 50 */
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	XK_Control_L, 0, 0, 0, 					/* 56 */
+ 	0, 0, 0, 0,
+ 	XK_Insert, 0, 0, 0,
+ 	XK_minus, XK_at, XK_at, 0,
+ 	XK_Caps_Lock, 0, 0, 0,				/* 60 */
+ 	XK_at, 0, 0, 0,
+ 	XK_question, 0, 0, 0,
+ 	XK_comma, XK_slash, XK_less, 0,
+ 	XK_period, XK_question, XK_greater, 0,
+ 	XK_Tab, 0, 0, 0,
+ 	XK_bracketleft /* Fn-x */, XK_grave, 0, 0,
+ 	XK_bracketright /* Fn-c */, 0 /* unused */, 0, 0,
+ 	XK_braceright /* Fn-v */, 0 /* doesn't work? */, 0, 0,
+ 	XK_Alt_L /* =Kana */, 0, 0, 0,
+ 	XK_Insert /* =Kanji */, 0, 0, 0, 				/* 70 */
+ 	XK_semicolon, 0, 0, 0,
+ 	XK_quotedbl, 0, 0, 0,
+ 	XK_colon, 0, 0, 0,
+ 	XK_numbersign, 0, 0, 0,
+ 	XK_dollar, 0, 0, 0,
+ 	XK_percent, 0, 0, 0,
+ 	XK_underscore, 0, 0, 0,
+ 	XK_ampersand, 0, 0, 0,
+ 	XK_asterisk, 0, 0, 0,
+ 	XK_parenleft, 0, 0, 0,				/* 80 */
+ 	XK_Delete, 0, 0, 0,
+ 	XK_braceleft /* Fn-Z */, XK_asciitilde, 0, 0,
+ 	XK_equal, 0, 0, 0,
+ 	XK_Return /* back OK */, 0, 0, 0,
+ 	XK_asciitilde, 0, 0, 0,
+ 	XK_less, 0, 0, 0,
+ 	XK_greater, 0, 0, 0,
+ 	XK_Home /* calendar */, 0, 0, 0,
+ 	XK_Next /* contacts */, 0, 0, 0,
+ 	XK_Prior /* mail */, 0, 0, 0,				/* 90 */
+ 	0 /* action; no key! */, 0, 0, 0,
+ 	XK_space, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	XK_Escape /* back cancel */, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,				/* 100 */
+ 	0, 0, 0, 0,
+ 	0 /* hingemoved? */, 0, 0, 0,
+ 	XK_period, XK_question, XK_greater, 0,
+ 	XK_Control_L, 0, 0, 0,
+ 	XK_Control_R, 0, 0, 0,
+ 	XK_Alt_L, 0, 0, 0,
+ 	XK_Alt_R, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	XK_F20 /* Power */, 0, 0, 0,
+ 	0, 0, 0, 0,				/* 110 */
+ 	0, 0, 0, 0,
+ 	XK_Shift_R, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,
+ 	0, 0, 0, 0,				/* 120 */
+ 	XK_Alt_L, 0, 0, 0,
+ 	XK_End, 0, 0, 0,
+ 	XK_Return, 0, 0, 0,
+ 	XK_Escape, 0, 0, 0,
+ 	XK_Prior, 0, 0, 0,
+ 	XK_Next, 0, 0, 0,
+ };
+ 
+ static struct hbtn
+ hbtn_c1000 = {
+         /* shift_l shift_r altgr
+          * mouse1 mouse2 mouse3
+          * pan action
+ 	 */
+ 	27, 112, 30,
+ 	88, 89, 90,
+ 	29, 0 /*29*/,
+ };
+ 
+ 
  static int fbvnc_keymap_ps2_de[N_SCANCODE*4] = {
  	0, 0, 0, 0,				/* 0 */
  	XK_Escape, 0, 0, 0,
***************
*** 865,870 ****
--- 1008,1016 ----
  	} else if (!strcmp(hwType, "sl-c700") || !strcmp(hwType, "c700")) {
  		fbvnc_keymap = fbvnc_keymap_c700;
  		hbtn = hbtn_c700;
+ 	} else if (!strcmp(hwType, "sl-c1000") || !strcmp(hwType, "c1000")) {
+ 		fbvnc_keymap = fbvnc_keymap_c1000;
+ 		hbtn = hbtn_c1000;
  	} else if (!strcmp(hwType, "sl-6000") || !strcmp(hwType, "6000")) {
  		fbvnc_keymap = fbvnc_keymap_zaurus_6000;
  		hbtn = hbtn_zaurus_6000;
***************
*** 905,917 ****
  		fprintf(stderr, "fn_action=%d, btn_state[hbtn.action]=%d\n",
  			fn_action, btn_state[hbtn.action]);
  	}
  	if (! (fn_action || btn_state[hbtn.action])) return 0;
  
  	if (key==XK_bracketleft || key==XK_Next) {
  		ev_zoom_out(0, 0);
  	} else if (key==XK_bracketright || key==XK_Prior) {
  		ev_zoom_in(0, 0);
! 	} else if (key==XK_Escape) {
  		system("zsuspend");
  	} else if (key==XK_Return) {
  		toggle_light();
--- 1051,1067 ----
  		fprintf(stderr, "fn_action=%d, btn_state[hbtn.action]=%d\n",
  			fn_action, btn_state[hbtn.action]);
  	}
+ 	if (key==XK_F20) {
+ 		system("zsuspend");
+ 		return 1;
+ 	}
  	if (! (fn_action || btn_state[hbtn.action])) return 0;
  
  	if (key==XK_bracketleft || key==XK_Next) {
  		ev_zoom_out(0, 0);
  	} else if (key==XK_bracketright || key==XK_Prior) {
  		ev_zoom_in(0, 0);
! 	} else if (key==XK_Escape || key==XK_F20) {
  		system("zsuspend");
  	} else if (key==XK_Return) {
  		toggle_light();
*** fbvnc/fbvnc.c	Mon Oct 18 14:08:46 2004
--- fbvnc-WLB/fbvnc.c	Thu Feb 23 22:17:49 2006
***************
*** 12,18 ****
  
  #include <sys/shm.h>
  
! #include <osis/ofbis.h>
  
  #include "vncviewer.h"
  #include "fbgl.h"
--- 12,18 ----
  
  #include <sys/shm.h>
  
! #include "ofbis-0.1.1/src/ofbis.h"
  
  #include "vncviewer.h"
  #include "fbgl.h"
***************
*** 150,156 ****
          } else if (!strcmp(hwType, "ps2us") || !strcmp(hwType, "ps2")) {
                  ts_type = TS_TYPE_PS2;
                  landscape_is_native=1;
!         } else if (!strcmp(hwType, "sl-c700") || !strcmp(hwType, "c700")) {
                  ts_type = TS_TYPE_C700;
                  landscape_is_native=0;
          } else if (!strcmp(hwType, "sl-6000") || !strcmp(hwType, "6000")) {
--- 150,157 ----
          } else if (!strcmp(hwType, "ps2us") || !strcmp(hwType, "ps2")) {
                  ts_type = TS_TYPE_PS2;
                  landscape_is_native=1;
!         } else if (!strcmp(hwType, "sl-c700") || !strcmp(hwType, "c700")
!         	|| !strcmp(hwType, "sl-c1000") || !strcmp(hwType, "c1000")) {
                  ts_type = TS_TYPE_C700;
                  landscape_is_native=0;
          } else if (!strcmp(hwType, "sl-6000") || !strcmp(hwType, "6000")) {
***************
*** 191,201 ****
  
  	fscanf(dinfo, "%99s", product);
  	if (debug) fprintf(stderr, "hwdetect: product='%s'\n", product);
! 	if (!strcmp(product, "SL-C700")
! 	 || !strcmp(product, "SL-C750")
! 	 || !strcmp(product, "SL-C760")
! 	 || !strcmp(product, "SL-C850")
! 	 || !strcmp(product, "SL-C860")
  	) {
  		hwType = "c700";
  		if (debug) fprintf(stderr, "hwdetect: C700 detected\n");
--- 192,207 ----
  
  	fscanf(dinfo, "%99s", product);
  	if (debug) fprintf(stderr, "hwdetect: product='%s'\n", product);
! 	if (!strcmp(product, "SL-C1000")
! 	 || !strcmp(product, "SL-C3000")
! 	 || !strcmp(product, "SL-C3100")
! 	) {
! 		hwType = "c1000";
! 	} else if (!strcmp(product, "SL-C700")
! 		|| !strcmp(product, "SL-C750")
! 		|| !strcmp(product, "SL-C760")
! 		|| !strcmp(product, "SL-C850")
! 		|| !strcmp(product, "SL-C860")
  	) {
  		hwType = "c700";
  		if (debug) fprintf(stderr, "hwdetect: C700 detected\n");
*** fbvnc/args.c	Thu Jul 22 00:38:19 2004
--- fbvnc-WLB/args.c	Thu Feb 23 07:54:20 2006
***************
*** 82,88 ****
  	    "              [-passwd <passwd-file>]\n"
  	    "              [-period <ms>] [-delay <ms>]\n"
  	    "              [-debug]\n"
! 	    "              [-hw <zaurus|c700|ipaq|ps2us|ps2de>]\n"
  	    "              [-kdelay <msec>] [-krate <n-per-second>]\n"
  	    "              [-pnmfifo <path>] [-pnmcache <size>{k|M}]\n"
  	    "\n"
--- 82,88 ----
  	    "              [-passwd <passwd-file>]\n"
  	    "              [-period <ms>] [-delay <ms>]\n"
  	    "              [-debug]\n"
! 	    "              [-hw <zaurus|c700|c1000|ipaq|ps2us|ps2de>]\n"
  	    "              [-kdelay <msec>] [-krate <n-per-second>]\n"
  	    "              [-pnmfifo <path>] [-pnmcache <size>{k|M}]\n"
  	    "\n"

Reply to: