Exemplo n.º 1
0
func init() {
	//
	defaultMode = VGA
	initModes()
	underX = xker.Active()
	if underX {
		initX()
	} else {
		initConsole()
	}
	//  col.Init()
	setColours = nixfaerben
}
Exemplo n.º 2
0
func init() {
	//
	var err error
	if !xker.Active() {
		file, err = os.Open("/dev/input/mice")
		if err == nil {
			Def(0, 0, 1000, 1000)
			lastCommand = move
			oldButt = none
			mousepipe = make(chan Command)
			go catch()
		}
	} else {
		//    file = nil
		mousepipe = (chan Command)(nil)
	}
}
Exemplo n.º 3
0
func init() {
	//
	//           0         1         2         3         4         5         6         7         8         9
	//           012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
	bb = []byte("  1234567890 '  qwertzuiop +  asdfghjkl  ^ #yxcvbnm,.- +               789-456+1230,  <           /")
	//                       ß             ü            öä
	bb[12] = z.Sz
	bb[26] = z.Ue
	bb[39] = z.Oe
	bb[40] = z.Ae

	//           0         1         2         3         4         5         6         7         8         9
	//           012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
	bB = []byte("  !  $%&/()=?`  QWERTZUIOP *  ASDFGHJKL    'YXCVBNM;:_ *               789-456+1230,  >           /")
	//               §                     Ü            ÖÄ°
	bB[4] = z.Para
	bB[26] = z.UE
	bB[39] = z.OE
	bB[40] = z.AE
	bB[41] = z.Degree

	//           0         1         2         3         4         5         6         7         8         9
	//           012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
	aa = []byte("  !  $%&/()=?`  @WERTZUIOP ~  ASDFGHJKL    'YXCVBNM;:_ ~               {[]-456+123},  |           /")
	//              ²³             ¤       ü            öä     ¢   µ
	aa[3] = z.ToThe2
	aa[4] = z.ToThe3
	aa[18] = z.Euro
	aa[26] = z.Ue
	aa[39] = z.Oe
	aa[40] = z.Ae
	aa[46] = z.Copyright
	aa[50] = z.Mue

	//  //           0         1         2         3         4         5         6         7         8         9
	//  //           012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
	//  aA = []byte("  !  $%&/()=?`  @WERTZUIOP ~  ASDFGHJKL    'YXCVBNM;:_ ~               {[]-456+123},  |           /")
	//  //                              ®             ª       ¬    ¢   º ÷                    ± ¤     £ ×
	//  aA[19] = z.Registered
	//  aA[33] = z.Female
	//  aA[41] = z.Negate
	//  aA[46] = z.Copyright
	//  aA[50] = z.Male
	//  aA[52] = z.Division
	//  aA[73] = z.PlusMinus
	//  aA[75] = z.Euro
	//  aA[81] = z.Pound
	//  aA[83] = z.Times

	for b := 0; b < noKeycodes; b++ {
		kK[b] = Esc
	}
	kK[escape] = Esc
	kK[f1] = Help
	kK[f2] = LookFor
	kK[f3] = Act
	kK[f4] = Cfg
	kK[f5] = Mark
	kK[f6] = Demark
	kK[f7] = Paste
	kK[f8] = Deposit
	kK[f9] = Black
	kK[f10] = Red
	kK[f11] = Green
	kK[f12] = Blue
	kK[backspace] = Back
	kK[tab] = Tab
	kK[enter] = Enter
	kK[print_] = PrintScr
	kK[pos1] = Pos1
	kK[up] = Up
	kK[pageUp] = Up
	kK[left] = Left
	kK[right] = Right
	kK[end] = End
	kK[down] = Down
	kK[pageDown] = Down
	kK[insert] = Ins
	kK[delete] = Del
	kK[roll] = Roll
	kK[num7] = kK[pos1]
	kK[num8] = kK[up]
	kK[num9] = kK[pageUp]
	kK[num4] = kK[left]
	kK[num6] = kK[right]
	kK[num7] = kK[end]
	kK[num8] = kK[down]
	kK[num9] = kK[pageDown]
	kK[num0] = kK[insert]
	kK[numSep] = kK[delete]
	kK[numEnter] = kK[enter]
	kK[pause] = Pause
	kK[onOff] = OnOff
	kK[lower] = Lower
	kK[louder] = Louder

	text = [NComms]string{
		"       ", "Esc    ", "Enter  ", "<==    ",
		"<-     ", "->     ", "^      ", "_      ",
		"Pos1   ", "Ende   ",
		"Tab    ", "Entf   ", "Einfg  ",
		"F1     ", "F2     ", "F3     ", "F4     ", "F5     ", "F6     ", "F7     ", "F8     ",
		"F9     ", "F10    ", "F11    ", "F12    ",
		"drucke ", "rolle  ", "Pause  ",
		"an/aus ", "leiser ", "lauter ",
		"laufe  ",
		"hier   ", "ziehe  ", "hierhin",
		"dort   ", "schiebe", "dorthin",
		"da     ", "bewege ", "dahin  ",
		"Navigat"}

	lastbyte, lastcommand, lastdepth = 0, None, 0
	underX = xker.Active()
	if underX {
		xpipe = make(chan xker.Event)
		go catchX()
	} else {
		ker.InitTerminal()
		ker.InstallTerm(func() { ker.TerminateTerminal() })
		keypipe = make(chan byte, PIPE_BUF)
		if mouse.Ex() {
			mousepipe = mouse.Channel()
		} else {
			mousepipe = nil
		}
		navipipe = navi.Channel()
		go catch()
	}
}