示例#1
0
文件: imp.go 项目: CaptainSoOmA/Uni
func mouseEx() bool {
	//
	if underX {
		return true
	}
	return mouse.Ex()
}
示例#2
0
文件: mouse.go 项目: CaptainSoOmA/Uni
func mouseEx() bool {
	//
	if underX {
		return true // whoever drives X, has got a mouse
	}
	return mouse.Ex()
}
示例#3
0
文件: mouse.go 项目: CaptainSoOmA/Uni
func mouseCursorOn() bool {
	//
	if underX {
		return true // TODO
	}
	if !mouse.Ex() {
		return false
	}
	return mouseOn
}
示例#4
0
文件: mouse.go 项目: CaptainSoOmA/Uni
func underMouse(L, C, W, H uint) bool {
	//
	if underX {
		// we assume, a mouse is mousing
	} else {
		if !mouse.Ex() {
			return false
		}
	}
	l, c := MousePos()
	return L <= l && l < L+H &&
		C <= c && c < C+W
}
示例#5
0
文件: mouse.go 项目: CaptainSoOmA/Uni
func underMouseGr(x, y, x1, y1 int, T uint) bool {
	//
	if underX {
		// we assume, a mouse is mousing
	} else {
		if !mouse.Ex() {
			return false
		}
	}
	xm, ym := MousePosGr()
	t := int(T)
	intord(&x, &y, &x1, &y1)
	return x <= xm+t && xm <= x1+t &&
		y <= ym+t && ym <= y1+t
}
示例#6
0
文件: mouse.go 项目: CaptainSoOmA/Uni
func mouseCursor(on bool) {
	//
	mouseOn = on
	if underX {
		return // TODO
	}
	if !mouse.Ex() {
		return
	}
	if mouseOn {
		ar(fbcop, fbmem, nil, uint(xMouse), uint(yMouse), uint(xMouse+pointerW-1), uint(yMouse+pointerH-1))
		xMouse, yMouse = mouse.Pos()
		mousePointer(xMouse, yMouse)
	}
}
示例#7
0
文件: modes.go 项目: CaptainSoOmA/Uni
func switch_(M Mode) {
	//
	if M == mode || // && M != maxMode
		!Switchable(M) {
		return
	}
	mode = M
	Colours(col.ScreenF, col.ScreenB)
	if underX {
		xker.Switch(nX[mode], nY[mode])
	} else {
		Colours(col.ScreenF, col.ScreenB)
		Cls()
		if mouse.Ex() {
			mouse.Def(0, 0, nX[mode], nY[mode])
		}
	}
	switchFontsize(font.Normal)
}
示例#8
0
文件: imp.go 项目: CaptainSoOmA/Uni
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()
	}
}