Re: Terminal keyboard and mouse

2020-06-09 Thread JPLRouge
Hello

I finally solved (99.9%) the problem of scratching the mouse in the management 
of the terminal (in linux)

It was while developing my designer for the terminal that I realized that the 
events of the mouse went up at breakneck speed and the buffer was too small, it 
piled up  in short !!!

I also started to see the terminal management for windows but I prefer to 
finish my terminal designer whose APIs which I use to carry it out will be 
online


Re: Terminal keyboard and mouse

2020-05-20 Thread JPLRouge
change terminal key

> ATTN PROC CALL Keyboard simulation done by the program and not by the keyboard

→ ATTN keyboard simulation →Passes program name to application server → PROC 
keyboard simulation →Transmits the name of the procedure to be executed in 
Internal → CALL keyboard simulation →Transmits the name of the procedure to be 
executed in External

exemple: if use import termcurs.nim


var callQuery: Table[string, proc(fld : var FIELD)]

var combo  = new(GRIDSFL)
#===
proc callRefTyp(fld : var FIELD) =
  var g_pos : int = -1
  combo  = newGRID("COMBO01",2,2,20)
  
  var g_type  = defCell("Ref.Type",19,ALPHA)
  
  setHeaders(combo, @[g_type])
  addRows(combo, @["TEXT_FREE"])
  addRows(combo, @["ALPHA"])
  addRows(combo, @["ALPHA_UPPER"])
  addRows(combo, @["ALPHA_NUMERIC"])
  addRows(combo, @["ALPHA_NUMERIC_UPPER"])
  addRows(combo, @["TEXT_FULL"])
  addRows(combo, @["PASSWORD"])
  addRows(combo, @["DIGIT"])
  addRows(combo, @["DIGIT_SIGNED"])
  addRows(combo, @["DECIMAL"])
  addRows(combo, @["DECIMAL_SIGNED"])
  addRows(combo, @["DATE_ISO"])
  addRows(combo, @["DATE_FR"])
  addRows(combo, @["DATE_US"])
  addRows(combo, @["TELEPHONE"])
  addRows(combo, @["MAIL_ISO"])
  addRows(combo, @["YES_NO"])
  addRows(combo, @["SWITCH"])
  addRows(combo, @["FPROC"])
  addRows(combo, @["FCALL"])
  printGridHeader(combo)
  
  case fld.text
of "TEXT_FREE": g_pos = 0
of "ALPHA": g_pos = 1
of "ALPHA_UPPER"  : g_pos = 2
of "ALPHA_NUMERIC": g_pos = 3
of "ALPHA_NUMERIC_UPPER"  : g_pos = 4
of "TEXT_FULL": g_pos = 5
of "PASSWORD" : g_pos = 6
of "DIGIT": g_pos = 7
of "DIGIT_SIGNED" : g_pos = 8
of "DECIMAL"  : g_pos = 9
of "DECIMAL_SIGNED"   : g_pos = 10
of "DATE_ISO" : g_pos = 11
of "DATE_FR"  : g_pos = 12
of "DATE_US"  : g_pos = 13
of "TELEPHONE" : g_pos = 14
of "MAIL_ISO" : g_pos = 15
of "YES_NO"   : g_pos = 16
of "SWITCH"   : g_pos = 17
of "FPROC": g_pos = 18
of "FCALL": g_pos = 19
else : discard
  
  while true :
let (keys, val) = ioGrid(combo,g_pos)

case keys
  of Key.Enter :
fld.text  = $val[0]
break
  else: discard

callQuery["callRefTyp"] = callRefTyp

#===


...
  of Key.PROC:
  if isVoidF(pnFx,Index(pnFx)) :
callQuery[getVoidF(pnFx,Index(pnFx))] (pnFx.field[Index(pnFx)])
fldF.reftyp = parseEnum[REFTYP](pnFx.getTextF(F_F1[Freftyp]))
setTerminal()
printPanel(base)


Run


Re: Terminal keyboard and mouse

2020-04-20 Thread JPLRouge
2020-04-20 correctif Key change: enum → to respect enum:adding the table with a 
functional suite


Re: Terminal keyboard and mouse

2020-04-20 Thread JPLRouge
I will integrate this into the function, thank you this is more judicious


Re: Terminal keyboard and mouse

2020-04-19 Thread Arrrrrrrrr
Good job. Now I think that eventually enum with holes with get deprecated 
[https://github.com/nim-lang/Nim/issues/14001#issuecomment-614976730](https://github.com/nim-lang/Nim/issues/14001#issuecomment-614976730),
 so If I were you I'd find a replacement for them, for example:


const TO_INT = block:
  var intList: array[Key, int]
  intList[Key.Tab] = 9
  intList[Key.Backspace] = 127
  # etc
  intList


Run

That way you have more control without any problematic holes.


Re: Terminal keyboard and mouse

2020-04-18 Thread JPLRouge
update

Update → 2020-04-16 add proc (key) = getFunc() read touche omit key.Char

supported UTF8 → 2020-04-18 correctif line 572 if key == Key.None : key = 
Key.Char { ;) error copy from test}


Re: Terminal keyboard and mouse

2020-04-09 Thread JPLRouge
#enthus1ast You are free to use it, your idea is not bad I just finished 
(finished) on the Linux side ;)


Re: Terminal keyboard and mouse

2020-04-09 Thread enthus1ast
yeah the UTF-8 input fix is still only in my head ...


Terminal keyboard and mouse

2020-04-08 Thread JPLRouge
hello

termkey.nim

keyboard and mouse management

Linux view conforms to specifications

UTF8

I thank #enthus1ast 
[https://github.com/johnnovak/illwill](https://github.com/johnnovak/illwill)

Manages UTF8

all keyboard keys and mouse

It manages the Linux keyboard according to the GNU specifications

pure nim

[https://github.com/AS400JPLPC/nim_termkey](https://github.com/AS400JPLPC/nim_termkey)