• Here part of the code with input/output example:

    // touchKeyPadCalc2.js
    // (c)20181004_aO
    var kvs = "789CA456*/123+-00.==" // key values grid linear
      , tkp = new (require("TouchKeyPad"))(
         0,141,24,103,5,4,kvs) // grid area, cols, rows
      , trd = new (require("TouchRD"))(B1,A5,A6,A7
        ,function(x,y,t) { if (!t.t) // on un-touch:
          console.log(t.x,t.y,tkp.key(t.x,t.y),tkp­.k,tkp.r,tkp.c); }
        ,require("TSRD26_142x104_cfg")
        );
    

    The actual calculator is still on the list (suggestions are welcome) as well as attaching any kind of display. Output of input shows in console so far (: - Touching 8 2 . 5 x 3 = produces this output (formatted and 'headed' posthume for legibility):

    `
    touched lup lin -grid-
    @       key key row col
      x   y val idx idx idx
    --- --- --- --- --- ---
     38  36  8    1   0   1
     39  76  2   11   2   1
     64 100  .   17   3   2
     40  58  5    6   1   1
     96  57  *    8   1   3
     69  75  3   12   2   2
    108  96  =   18   3   3
    `
    

    PS: Configured screen resolution is 142 W x 104 H spots (pixels), 0/0 is at left (x) top (y). Reasons for chosen resolution will be subject of another conversation.

    ...more to come...

About

Avatar for allObjects @allObjects started