B4A Library Dyna Key, customs keyboards library.

Discussion in 'Additional libraries, classes and official updates' started by ELCHARO, May 26, 2015.

  1. ELCHARO

    ELCHARO Member Licensed User

    HI:

    This is my first posted library, i wait feedbak of the forum.

    Not release library source code yet. I wait firsts opinions, ideas and minor bug if founded. (see the photos)

    I think that version 1.0 are not for realease (near alpha) .
    I need to polish to make easier to beginners.
    I apreciate your's opinion's.



    Calc KeyBoard.png Text KeyBoard2.png or MathCalc KeyBoard3.png

    all full customs keys, (text, size, colors). Easy and simple way to catch keys inputs.

    I hope be usefull.

    By, Ricardo.




    Code:
    'Definitions
        Dim FuncKeyb  As DynaKey      ' define a keyboard class
        Dim font1,font2,font3,font4 As Float   ' define fonts predefined.
        Dim ufont1,ufont2,ufont3 As Float

    ' init, and 5x5 array of keys ,parents and size, (see full code)
        NumKeyb.Initialize(parentname,act,pan1,00%x,50%y,100%x,50%y,5,5)   'parent,x,y,w,h,col,rows (all boxes botons)

    ' defining a font make more visual "homogeneus?" and easy to change.
    ' Test in others phones size. ( work for me)
        font1=NumKeyb.SETFONTsize("8",Typeface.DEFAULT,58,1,1)
        font2=NumKeyb.SETFONTsize(
    "MR",Typeface.DEFAULT,58,1,1)
        ..........................................

    ' define any key in  x,y array position  , in this case 5x5
    '+ cell size (if ocupies more that one , like spacerbar horizontal or vertical
    ' name, font and color
    ' uppername , font and color
    ' gradient colors background
    ' tag that is send back to you by dynakey class.
            NumKeyb.addbutton(0,0,1,1,"(",font3,Colors.white,"",ufont1,Colors.blue,Colors.darkgray,Colors.black,"(")
            NumKeyb.addbutton(
    1,0,1,1,")",font3,Colors.white,"",ufont1,Colors.black,Colors.DarkGray,Colors.black,")")
            NumKeyb.addbutton(
    2,0,1,1,"<<",font3,Colors.white,"",ufont1,Colors.red,Colors.DarkGray,Colors.black,"<<")
         
    ...........................................................................................

    Sub DynaKey_Click(b As Button)
        vib.Vibrate(
    30)
        
    ToastMessageShow(b.tag,False)
        
    Select b.tag
            
    Case "@"  ' The idea is that arroba (or you prefer) , use the keyname of the boton.
                     ' If you press A, read A from b.text
                     ' Both click and long click send a tag and a the principal name.
                     ' We must supose a long click are relation of the litle upper name.
                Log("   "&b.Text)

            
    Case "U"
                
    ToastMessageShow("DevMode",True)
            
    Case "F"
                
    ToastMessageShow("AppMode",True)
            
    Case "K"
                
    ToastMessageShow("FixMode",True)
            
    Case "<"
            
    Case ">"
            
    Case "ABC"
                setpanels (
    True,False,False)
            
    Case "123","_"
                setpanels (
    False,False,True)
            
    Case "FUN"
                setpanels (
    True,False,False)
            
    Case ">>"
            
    Case "<<"    
            
    Case "0","1","2","3","4","5","6","7","8","9","*","."
            
    Case "MR"
            
    Case "M+"
            
    Case "M-"
            
    Case "CPI","COS(","SIN(","TAN(","LOG(","POWER","RAIZ","ABS","MOD","(",")","/","%"
            
    Case "*","/","+","-"
            
    Case "="
            
    Case Else
                
    ToastMessageShow(b.tag,False)
        
    End Select

    End Sub

    ( Library + Demo Source, Copy dynakey files to libraries first!!)
     

    Attached Files:

    Last edited: May 26, 2015
  2. Albert Lin

    Albert Lin Member Licensed User

    A referenced library is missing: expressionevaluator
     
  3. DonManfred

    DonManfred Expert Licensed User

    Have you tried to search for it?
     
  4. Albert Lin

    Albert Lin Member Licensed User

    I have search, but couldn't find it
     
  5. cambopad

    cambopad Active Member Licensed User

    So can this keyboard used for the whole system or just for our app?
     
  6. ELCHARO

    ELCHARO Member Licensed User

    Sorry but out for a long time.
    1- I put "expressionevaluator" in search. Stay in the tops positions , with a LIBRARY tag.
    2-Is for custom apps with custom inputs like demo do. I don´t know how replace the syskeyb, sometimes fight both keyinputs, I found the solutions in this web and use.
    "Custom" is any action you need to assign, not only letters/numbers, can direct jump to other apps or any assigment you like to use. Is flexible and you take time to understand the source is easy to modificate.

    By.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice