From 47a2003ea266db37b4da988c3e5e032587002c10 Mon Sep 17 00:00:00 2001 From: prez9456 <57645205+prez9456@users.noreply.github.com> Date: Mon, 28 Mar 2022 14:36:01 -0600 Subject: [PATCH 1/2] added file --- src/layouts/Dvorak.py | 131 ++++++++++++++++++ src/layouts/__pycache__/QWERTY.cpython-39.pyc | Bin 4426 -> 0 bytes 2 files changed, 131 insertions(+) create mode 100644 src/layouts/Dvorak.py delete mode 100644 src/layouts/__pycache__/QWERTY.cpython-39.pyc diff --git a/src/layouts/Dvorak.py b/src/layouts/Dvorak.py new file mode 100644 index 0000000..a930eaa --- /dev/null +++ b/src/layouts/Dvorak.py @@ -0,0 +1,131 @@ +import tkinter as tk +from tkinter import ttk + +hold = " " + +def press(char): + global hold + hold += char + +class QWERTY(tk.Tk): + + def __init__(self): + self.layout() + + + def layout(self): + quote = ttk.Button(text = '\'' , width = 6, command = lambda : press('\'')) + quote.grid(row = 3 , column = 5, ipadx = 6 , ipady = 10) + + comma = ttk.Button(text = ',' , width = 6, command = lambda : press(',')) + comma.grid(row = 3 , column = 6, ipadx = 6 , ipady = 10) + + period = ttk.Button(text = '.' , width = 6, command = lambda : press('.')) + period.grid(row = 3 , column = 7, ipadx = 6 , ipady = 10) + + P = ttk.Button(text = 'P' , width = 6, command = lambda : press('P')) + P.grid(row = 3 , column = 8, ipadx = 6 , ipady = 10) + + Y = ttk.Button(text = 'Y' , width = 6, command = lambda : press('Y')) + Y.grid(row = 3 , column = 9, ipadx = 6 , ipady = 10) + + F = ttk.Button(text = 'F' , width = 6, command = lambda : press('F')) + F.grid(row = 4 , column = 10, ipadx = 6 , ipady = 10) + + G = ttk.Button(text = 'G' , width = 6, command = lambda : press('G')) + G.grid(row = 4 , column = 11, ipadx = 6 , ipady = 10) + + C = ttk.Button(text = 'C' , width = 6, command = lambda : press('C')) + C.grid(row = 5 , column = 12, ipadx = 6 , ipady = 10) + + R = ttk.Button(text = 'R' , width = 6, command = lambda : press('R')) + R.grid(row = 3 , column = 13, ipadx = 6 , ipady = 10) + + L = ttk.Button(text = 'L' , width = 6, command = lambda : press('L')) + L.grid(row = 4 , column = 14, ipadx = 6 , ipady = 10) + + + + + + + + + + + + + + # SECOND ROW + A = ttk.Button(text = 'A' , width = 6, command = lambda : press('A')) + A.grid(row = 4 , column = 5, ipadx = 6 , ipady = 10) + + O = ttk.Button(text = 'O' , width = 6, command = lambda : press('O')) + O.grid(row = 3 , column = 13, ipadx = 6 , ipady = 10) + + E = ttk.Button(text = 'E' , width = 6, command = lambda : press('E')) + E.grid(row = 3 , column = 7, ipadx = 6 , ipady = 10) + + U = ttk.Button(text = 'U' , width = 6, command = lambda : press('U')) + U.grid(row = 3 , column = 11, ipadx = 6 , ipady = 10) + + I = ttk.Button(text = 'I' , width = 6, command = lambda : press('I')) + I.grid(row = 3 , column = 12, ipadx = 6 , ipady = 10) + + D = ttk.Button(text = 'D' , width = 6, command = lambda : press('D')) + D.grid(row = 4 , column = 7, ipadx = 6 , ipady = 10) + + H = ttk.Button(text = 'H' , width = 6, command = lambda : press('H')) + H.grid(row = 4 , column = 10, ipadx = 6 , ipady = 10) + + T = ttk.Button(text = 'T' , width = 6, command = lambda : press('T')) + T.grid(row = 3 , column = 9, ipadx = 6 , ipady = 10) + + N = ttk.Button(text = 'N' , width = 6, command = lambda : press('N')) + N.grid(row = 5 , column = 11, ipadx = 6 , ipady = 10) + + S = ttk.Button(text = 'S' , width = 6, command = lambda : press('S')) + S.grid(row = 4 , column = 6, ipadx = 6 , ipady = 10) + + + + + + + + J = ttk.Button(text = 'J' , width = 6, command = lambda : press('J')) + J.grid(row = 4 , column = 11, ipadx = 6 , ipady = 10) + + K = ttk.Button(text = 'K' , width = 6, command = lambda : press('K')) + K.grid(row = 4 , column = 12, ipadx = 6 , ipady = 10) + + + + # THIRD ROW + Z = ttk.Button(text = 'Z' , width = 6, command = lambda : press('Z')) + Z.grid(row = 5 , column = 6, ipadx = 6 , ipady = 10) + + + X = ttk.Button(text = 'X' , width = 6, command = lambda : press('X')) + X.grid(row = 5 , column = 7, ipadx = 6 , ipady = 10) + + + + + + V = ttk.Button(text = 'V' , width = 6, command = lambda : press('V')) + V.grid(row = 5 , column = 9, ipadx = 6 , ipady = 10) + + B = ttk.Button( text= 'B' , width = 6 , command = lambda : press('B')) + B.grid(row = 5 , column = 10 , ipadx = 6 ,ipady = 10) + + Q = ttk.Button(text = 'Q' , width = 6, command = lambda : press('Q')) + Q.grid(row = 3 , column = 5, ipadx = 6 , ipady = 10) + + W = ttk.Button(text = 'W' , width = 6, command = lambda : press('W')) + W.grid(row = 3 , column = 6, ipadx = 6 , ipady = 10) + + + + M = ttk.Button(text = 'M' , width = 6, command = lambda : press('M')) + M.grid(row = 5 , column = 12, ipadx = 6 , ipady = 10) \ No newline at end of file diff --git a/src/layouts/__pycache__/QWERTY.cpython-39.pyc b/src/layouts/__pycache__/QWERTY.cpython-39.pyc deleted file mode 100644 index d92d9ea7fe0dfcc6e4c9c7776e5688839d6e125d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4426 zcma)=TT|Oc6vwrad;x6kcXFY*)=eOg8-Wl)xHKf8kOa~su4g>La*M$iD#??;Y@d?X ze24atkCCsjPo3$LpZk`lo^u2%P#J4IBUvl|{PXT#(%A(ooo?0O_1u`;`r4ss|6t?f z%Y?=}Z0>#7*_zGDT9(1PUe+plR%e=RScYxdvCmr8e5%=TJMmew6GgTY`($L}HrvoL z$p(B^TgxzEc;49PI&6!uxhdFr8rP;Y3w~`wJ7oAZbGufy@x8EZIft5) z0P5R%VJ7#+Ejn(_s@nV0xusg6UMW^RH@C9*Ecc?gzg4pwdu-L(uhqS=^*ygtDIHi| zsaDOoP9ayO^KS0d+vV4r@5lG{MQqP0x^5i1f&I~Rrv>%}JUscr&*ous&%v%pX=HVq z**YX(*pLM#VaH(HaS`|J&Bx2NKefL!ND{{DVBRp&xZgb-vs*0xN+b4nNdQDLpD$HQ zUOta``MqTa9Y;es{_NDRjsS>5qm=(PFy$SFz4m)-$G#YUFwS;#yn=8xX}5eanNPJs zyA8)hl+Jac^bnPTc3M&fH;8HvQ613kl$6O$qPjvSBl*h4y!nYUQm&T?$c`p?yVC zZM+SrtN+XX8c^3ImEtL)!r6ZhR7O&1o+c`s{SQFhkW@QwCn}u%O`ygk)xkT63THnK z)GbMM@=l_{*-rp9DXA{rMN~NZ+d$osR5$M?DxCdYpzcYkhxZT_&i+17Q_3=KU!gx z@m@UWhMi!`>fQ_Zt)||AV{Ze0RIu0T^3h27u$0r4V4LdlOObNQ3=?VKlqcAGb@`P@ z`6v>8+;7yqS0lZbkG+jHI1=ocy8L>i{F;>G6f4-ex;zspCxYTmll-N+{6?hwCK4pa zr&+Kk>hiHj`Gl0?LPf9*b@{DG`JH3AU`y&=>Qd9^5|^$=H{g%z-pR=RP6ytn>fYOt z-r2yrqVA>in&$90@IF`f-i_?R!6qO>Oa9@54y%FM)SW-AhkX(;V`F_a}AlqsacE zi|S6saPY525nrf#Uacz3-<*=28F6rGp*5F76ELkXM)4fY*fg`!G)U7GO&V1GsZ3Kj zoj{lh6;%}~0rb4m!$nU5-L`a((G5XYkD{hrXb_<#63(WWm%9x+jrFo_U12j68RU*P z^d21_q))9Q*D^8uBe!Z*iut@~&F3pMyI#iQR6hTE-75Q^I5>Yg*x@r5d$_Q~&Be(o zsV7Z`mYNBX@ODd8ujmNf+oen6;6jwvy+YsICG0GtNY45lnZy5D(DFISQo0H1{{Y?P Bo*MuF From 7528682b00737211b8376f7d22d0f76f5b7e0ca7 Mon Sep 17 00:00:00 2001 From: Andy Donis Paz <57645205+prez9456@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:08:51 -0600 Subject: [PATCH 2/2] added all keyboard layouts needed --- src/classes/App.py | 5 +- src/classes/__pycache__/App.cpython-39.pyc | Bin 1376 -> 0 bytes src/layouts/Chubon.py | 105 +++++++++++++++++++ src/layouts/Dvorak.py | 90 +++++++--------- src/layouts/Opti.py | 101 ++++++++++++++++++ src/layouts/SquareAlphabetic.py | 113 +++++++++++++++++++++ 6 files changed, 356 insertions(+), 58 deletions(-) delete mode 100644 src/classes/__pycache__/App.cpython-39.pyc create mode 100644 src/layouts/Chubon.py create mode 100644 src/layouts/Opti.py create mode 100644 src/layouts/SquareAlphabetic.py diff --git a/src/classes/App.py b/src/classes/App.py index 5054d2d..83b5112 100644 --- a/src/classes/App.py +++ b/src/classes/App.py @@ -1,7 +1,8 @@ import tkinter as tk from tkinter import ttk -import layouts.QWERTY as QWERTY +import layouts.Opti as QWERTY + class App(tk.Tk): @@ -26,4 +27,4 @@ def typeBox(self): entry.grid(row=2, columnspan= 100, ipadx= 999, ipady=5) def keyboard(self): - QWERTY.QWERTY() \ No newline at end of file + QWERTY.Opti() \ No newline at end of file diff --git a/src/classes/__pycache__/App.cpython-39.pyc b/src/classes/__pycache__/App.cpython-39.pyc deleted file mode 100644 index 5ae2a879886ee9d1f73a9eea893ccda6d3b3f5cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1376 zcmb_cOOG5i5VqajGoINQAdz?_0p-XXvb#YDLKGoFhyr4@2oi{5wbb&qouPO7725+l zqs@h^lvDo0?s5K7-y#lZ{sJee+`VYBXWVjCxvRRKpIeT{Ljvp1*SiOCK*(Qs*jynT zzJ_f-2cn3gIS~{%%SpimqwTw(2t`QA1EK;Io)8skdKkS3L{HI&WD>36Te3f)P2k)t z#lz-;uzuOkfNAeuu$Sa1RaCJPE`rvn2vwwdCqzW5uQ>4DOA->%hX8{nxLemL?HnOP z86D%c`#>CdK~CuzD2~Y~Q}m2_DNwAFLKUFoqSM|P*d%?hi)-EfurF2gWM$@(q={VSaxI2nSRQ1qkhS1bT@~7yMZ?@o3?4d@mD69P5q+nR z+&9%x(>GcwFStdmQQ)&KzZGpltMjM82T79V(%K|hk$?8m+wm_}8ym|~ExwGut)QXvrS3r|M@ixdU!IHh*yC7J+GlX8I%PlOro6G-Jv$=%9E(2L(mIgzb_mI4g z$|F+g$!$yFp5l143>T}Zma&>Kl(D>0%U6!yW9Q}W-1pm@J~KRv$x^P?wb z3$zy_;eX~M*cN?|4iV=Nop8i|DGLqwA0|mrsd^L`wMNiyK+7TjbM*v a{*#RezLyxG;dk1MzrrS2jK%4Qjo7~!Ffi`` diff --git a/src/layouts/Chubon.py b/src/layouts/Chubon.py new file mode 100644 index 0000000..31bcf76 --- /dev/null +++ b/src/layouts/Chubon.py @@ -0,0 +1,105 @@ +import tkinter as tk +from tkinter import ttk + +hold = " " + +def press(char): + global hold + hold += char + +class Chubon(tk.Tk): + + def __init__(self): + self.layout() + + + def layout(self): + V = ttk.Button(text = 'V' , width = 6, command = lambda : press('V')) + V.grid(row = 3 , column = 8, ipadx = 6 , ipady = 10) + + U = ttk.Button(text = 'U' , width = 6, command = lambda : press('U')) + U.grid(row = 3 , column = 9, ipadx = 6 , ipady = 10) + + P = ttk.Button(text = 'P' , width = 6, command = lambda : press('P')) + P.grid(row = 3 , column = 10, ipadx = 6 , ipady = 10) + + + # SECOND ROW + Q = ttk.Button(text = 'Q' , width = 6, command = lambda : press('Q')) + Q.grid(row = 4 , column = 5, ipadx = 6 , ipady = 10) + + M = ttk.Button(text = 'M' , width = 6, command = lambda : press('M')) + M.grid(row = 4 , column = 6, ipadx = 6 , ipady = 10) + + I = ttk.Button(text = 'I' , width = 6, command = lambda : press('I')) + I.grid(row = 4 , column = 7, ipadx = 6 , ipady = 10) + + T = ttk.Button(text = 'T' , width = 6, command = lambda : press('T')) + T.grid(row = 4 , column = 8, ipadx = 6 , ipady = 10) + + S = ttk.Button(text = 'S' , width = 6, command = lambda : press('S')) + S.grid(row = 4 , column = 9, ipadx = 6 , ipady = 10) + + C = ttk.Button(text = 'C' , width = 6, command = lambda : press('C')) + C.grid(row = 4 , column = 10, ipadx = 6 , ipady = 10) + + K = ttk.Button(text = 'K' , width = 6, command = lambda : press('K')) + K.grid(row = 4 , column = 11, ipadx = 6 , ipady = 10) + + Z = ttk.Button(text = 'Z' , width = 6, command = lambda : press('Z')) + Z.grid(row = 4 , column = 12, ipadx = 6 , ipady = 10) + + + # THIRD ROW + J = ttk.Button(text = 'J' , width = 6, command = lambda : press('J')) + J.grid(row = 5 , column = 4, ipadx = 6 , ipady = 10) + + G = ttk.Button(text = 'G' , width = 6, command = lambda : press('G')) + G.grid(row = 5 , column = 5, ipadx = 6 , ipady = 10) + + N = ttk.Button(text = 'N' , width = 6, command = lambda : press('N')) + N.grid(row = 5 , column = 6, ipadx = 6 , ipady = 10) + + R = ttk.Button(text = 'R' , width = 6, command = lambda : press('R')) + R.grid(row = 5 , column = 7, ipadx = 6 , ipady = 10) + + E = ttk.Button(text = 'E' , width = 6, command = lambda : press('E')) + E.grid(row = 5 , column = 8, ipadx = 6 , ipady = 10) + + H = ttk.Button(text = 'H' , width = 6, command = lambda : press('H')) + H.grid(row = 5 , column = 9, ipadx = 6 , ipady = 10) + + B = ttk.Button( text= 'B' , width = 6 , command = lambda : press('B')) + B.grid(row = 5 , column = 10 , ipadx = 6 ,ipady = 10) + + Y = ttk.Button(text = 'Y' , width = 6, command = lambda : press('Y')) + Y.grid(row = 5 , column = 11, ipadx = 6 , ipady = 10) + + X = ttk.Button(text = 'X' , width = 6, command = lambda : press('X')) + X.grid(row = 5 , column = 12, ipadx = 6 , ipady = 10) + + + # FOURTH ROW + F = ttk.Button(text = 'F' , width = 6, command = lambda : press('F')) + F.grid(row = 6 , column = 5, ipadx = 6 , ipady = 10) + + O = ttk.Button(text = 'O' , width = 6, command = lambda : press('O')) + O.grid(row = 6 , column = 6, ipadx = 6 , ipady = 10) + + A = ttk.Button(text = 'A' , width = 6, command = lambda : press('A')) + A.grid(row = 6 , column = 7, ipadx = 6 , ipady = 10) + + D = ttk.Button(text = 'D' , width = 6, command = lambda : press('D')) + D.grid(row = 6 , column = 8, ipadx = 6 , ipady = 10) + + L = ttk.Button(text = 'L' , width = 6, command = lambda : press('L')) + L.grid(row = 6 , column = 9, ipadx = 6 , ipady = 10) + + W = ttk.Button(text = 'W' , width = 6, command = lambda : press('W')) + W.grid(row = 6 , column = 10, ipadx = 6 , ipady = 10) + + period = ttk.Button(text = '.' , width = 6, command = lambda : press('.')) + period.grid(row = 6 , column = 11, ipadx = 6 , ipady = 10) + + comma = ttk.Button(text = ',' , width = 6, command = lambda : press(',')) + comma.grid(row = 6 , column = 12, ipadx = 6 , ipady = 10) \ No newline at end of file diff --git a/src/layouts/Dvorak.py b/src/layouts/Dvorak.py index a930eaa..8ff2443 100644 --- a/src/layouts/Dvorak.py +++ b/src/layouts/Dvorak.py @@ -7,7 +7,7 @@ def press(char): global hold hold += char -class QWERTY(tk.Tk): +class Dvorak(tk.Tk): def __init__(self): self.layout() @@ -30,102 +30,80 @@ def layout(self): Y.grid(row = 3 , column = 9, ipadx = 6 , ipady = 10) F = ttk.Button(text = 'F' , width = 6, command = lambda : press('F')) - F.grid(row = 4 , column = 10, ipadx = 6 , ipady = 10) + F.grid(row = 3 , column = 10, ipadx = 6 , ipady = 10) G = ttk.Button(text = 'G' , width = 6, command = lambda : press('G')) - G.grid(row = 4 , column = 11, ipadx = 6 , ipady = 10) + G.grid(row = 3 , column = 11, ipadx = 6 , ipady = 10) C = ttk.Button(text = 'C' , width = 6, command = lambda : press('C')) - C.grid(row = 5 , column = 12, ipadx = 6 , ipady = 10) + C.grid(row = 3 , column = 12, ipadx = 6 , ipady = 10) R = ttk.Button(text = 'R' , width = 6, command = lambda : press('R')) R.grid(row = 3 , column = 13, ipadx = 6 , ipady = 10) L = ttk.Button(text = 'L' , width = 6, command = lambda : press('L')) - L.grid(row = 4 , column = 14, ipadx = 6 , ipady = 10) - - - - - + L.grid(row = 3 , column = 14, ipadx = 6 , ipady = 10) - - - - - - # SECOND ROW A = ttk.Button(text = 'A' , width = 6, command = lambda : press('A')) A.grid(row = 4 , column = 5, ipadx = 6 , ipady = 10) O = ttk.Button(text = 'O' , width = 6, command = lambda : press('O')) - O.grid(row = 3 , column = 13, ipadx = 6 , ipady = 10) + O.grid(row = 4 , column = 6, ipadx = 6 , ipady = 10) E = ttk.Button(text = 'E' , width = 6, command = lambda : press('E')) - E.grid(row = 3 , column = 7, ipadx = 6 , ipady = 10) + E.grid(row = 4 , column = 7, ipadx = 6 , ipady = 10) U = ttk.Button(text = 'U' , width = 6, command = lambda : press('U')) - U.grid(row = 3 , column = 11, ipadx = 6 , ipady = 10) + U.grid(row = 4 , column = 8, ipadx = 6 , ipady = 10) I = ttk.Button(text = 'I' , width = 6, command = lambda : press('I')) - I.grid(row = 3 , column = 12, ipadx = 6 , ipady = 10) + I.grid(row = 4 , column = 9, ipadx = 6 , ipady = 10) D = ttk.Button(text = 'D' , width = 6, command = lambda : press('D')) - D.grid(row = 4 , column = 7, ipadx = 6 , ipady = 10) + D.grid(row = 4 , column = 10, ipadx = 6 , ipady = 10) H = ttk.Button(text = 'H' , width = 6, command = lambda : press('H')) - H.grid(row = 4 , column = 10, ipadx = 6 , ipady = 10) + H.grid(row = 4 , column = 11, ipadx = 6 , ipady = 10) T = ttk.Button(text = 'T' , width = 6, command = lambda : press('T')) - T.grid(row = 3 , column = 9, ipadx = 6 , ipady = 10) + T.grid(row = 4 , column = 12, ipadx = 6 , ipady = 10) N = ttk.Button(text = 'N' , width = 6, command = lambda : press('N')) - N.grid(row = 5 , column = 11, ipadx = 6 , ipady = 10) + N.grid(row = 4 , column = 13, ipadx = 6 , ipady = 10) S = ttk.Button(text = 'S' , width = 6, command = lambda : press('S')) - S.grid(row = 4 , column = 6, ipadx = 6 , ipady = 10) + S.grid(row = 4 , column = 14, ipadx = 6 , ipady = 10) - + # THIRD ROW + semi = ttk.Button(text = ';' , width = 6, command = lambda : press(';')) + semi.grid(row = 5 , column = 5, ipadx = 6 , ipady = 10) - + Q = ttk.Button(text = 'Q' , width = 6, command = lambda : press('Q')) + Q.grid(row = 5 , column = 6, ipadx = 6 , ipady = 10) - J = ttk.Button(text = 'J' , width = 6, command = lambda : press('J')) - J.grid(row = 4 , column = 11, ipadx = 6 , ipady = 10) - - K = ttk.Button(text = 'K' , width = 6, command = lambda : press('K')) - K.grid(row = 4 , column = 12, ipadx = 6 , ipady = 10) - + J.grid(row = 5 , column = 7, ipadx = 6 , ipady = 10) + K = ttk.Button(text = 'K' , width = 6, command = lambda : press('K')) + K.grid(row = 5 , column = 8, ipadx = 6 , ipady = 10) - # THIRD ROW - Z = ttk.Button(text = 'Z' , width = 6, command = lambda : press('Z')) - Z.grid(row = 5 , column = 6, ipadx = 6 , ipady = 10) - - X = ttk.Button(text = 'X' , width = 6, command = lambda : press('X')) - X.grid(row = 5 , column = 7, ipadx = 6 , ipady = 10) - - - - - - V = ttk.Button(text = 'V' , width = 6, command = lambda : press('V')) - V.grid(row = 5 , column = 9, ipadx = 6 , ipady = 10) - + X.grid(row = 5 , column = 9, ipadx = 6 , ipady = 10) + B = ttk.Button( text= 'B' , width = 6 , command = lambda : press('B')) B.grid(row = 5 , column = 10 , ipadx = 6 ,ipady = 10) - - Q = ttk.Button(text = 'Q' , width = 6, command = lambda : press('Q')) - Q.grid(row = 3 , column = 5, ipadx = 6 , ipady = 10) - + + M = ttk.Button(text = 'M' , width = 6, command = lambda : press('M')) + M.grid(row = 5 , column = 11, ipadx = 6 , ipady = 10) + W = ttk.Button(text = 'W' , width = 6, command = lambda : press('W')) - W.grid(row = 3 , column = 6, ipadx = 6 , ipady = 10) - - + W.grid(row = 5 , column = 12, ipadx = 6 , ipady = 10) + + V = ttk.Button(text = 'V' , width = 6, command = lambda : press('V')) + V.grid(row = 5 , column = 13, ipadx = 6 , ipady = 10) - M = ttk.Button(text = 'M' , width = 6, command = lambda : press('M')) - M.grid(row = 5 , column = 12, ipadx = 6 , ipady = 10) \ No newline at end of file + Z = ttk.Button(text = 'Z' , width = 6, command = lambda : press('Z')) + Z.grid(row = 5 , column = 14, ipadx = 6 , ipady = 10) \ No newline at end of file diff --git a/src/layouts/Opti.py b/src/layouts/Opti.py new file mode 100644 index 0000000..42b1f03 --- /dev/null +++ b/src/layouts/Opti.py @@ -0,0 +1,101 @@ +import tkinter as tk +from tkinter import ttk + +hold = " " + +def press(char): + global hold + hold += char + +class Opti(tk.Tk): + + def __init__(self): + self.layout() + + + def layout(self): + Q = ttk.Button(text = 'Q' , width = 6, command = lambda : press('Q')) + Q.grid(row = 3 , column = 5, ipadx = 6 , ipady = 10) + + K = ttk.Button(text = 'K' , width = 6, command = lambda : press('K')) + K.grid(row = 3 , column = 6, ipadx = 6 , ipady = 10) + + C = ttk.Button(text = 'C' , width = 6, command = lambda : press('C')) + C.grid(row = 3 , column = 7, ipadx = 6 , ipady = 10) + + G = ttk.Button(text = 'G' , width = 6, command = lambda : press('G')) + G.grid(row = 3 , column = 8, ipadx = 6 , ipady = 10) + + V = ttk.Button(text = 'V' , width = 6, command = lambda : press('V')) + V.grid(row = 3 , column = 9, ipadx = 6 , ipady = 10) + + J = ttk.Button(text = 'J' , width = 6, command = lambda : press('J')) + J.grid(row = 3 , column = 10, ipadx = 6 , ipady = 10) + + + # SECOND ROW + S = ttk.Button(text = 'S' , width = 6, command = lambda : press('S')) + S.grid(row = 4 , column = 6, ipadx = 6 , ipady = 10) + + I = ttk.Button(text = 'I' , width = 6, command = lambda : press('I')) + I.grid(row = 4 , column = 7, ipadx = 6 , ipady = 10) + + N = ttk.Button(text = 'N' , width = 6, command = lambda : press('N')) + N.grid(row = 4 , column = 8, ipadx = 6 , ipady = 10) + + D = ttk.Button(text = 'D' , width = 6, command = lambda : press('D')) + D.grid(row = 4 , column = 9, ipadx = 6 , ipady = 10) + + + # THIRD ROW + W = ttk.Button(text = 'W' , width = 6, command = lambda : press('W')) + W.grid(row = 5 , column = 5, ipadx = 6 , ipady = 10) + + T = ttk.Button(text = 'T' , width = 6, command = lambda : press('T')) + T.grid(row = 5 , column = 6, ipadx = 6 , ipady = 10) + + H = ttk.Button(text = 'H' , width = 6, command = lambda : press('H')) + H.grid(row = 5 , column = 7, ipadx = 6 , ipady = 10) + + E = ttk.Button(text = 'E' , width = 6, command = lambda : press('E')) + E.grid(row = 5 , column = 8, ipadx = 6 , ipady = 10) + + A = ttk.Button(text = 'A' , width = 6, command = lambda : press('A')) + A.grid(row = 5 , column = 9, ipadx = 6 , ipady = 10) + + M = ttk.Button(text = 'M' , width = 6, command = lambda : press('M')) + M.grid(row = 5 , column = 10, ipadx = 6 , ipady = 10) + + + # FOURTH ROW + U = ttk.Button(text = 'U' , width = 6, command = lambda : press('U')) + U.grid(row = 6 , column = 6, ipadx = 6 , ipady = 10) + + O = ttk.Button(text = 'O' , width = 6, command = lambda : press('O')) + O.grid(row = 6 , column = 7, ipadx = 6 , ipady = 10) + + R = ttk.Button(text = 'R' , width = 6, command = lambda : press('R')) + R.grid(row = 6 , column = 8, ipadx = 6 , ipady = 10) + + L = ttk.Button(text = 'L' , width = 6, command = lambda : press('L')) + L.grid(row = 6 , column = 9, ipadx = 6 , ipady = 10) + + + # FIFTH ROW + Z = ttk.Button(text = 'Z' , width = 6, command = lambda : press('Z')) + Z.grid(row = 7 , column = 5, ipadx = 6 , ipady = 10) + + B = ttk.Button( text= 'B' , width = 6 , command = lambda : press('B')) + B.grid(row = 7 , column = 6 , ipadx = 6 ,ipady = 10) + + F = ttk.Button(text = 'F' , width = 6, command = lambda : press('F')) + F.grid(row = 7 , column = 7, ipadx = 6 , ipady = 10) + + Y = ttk.Button(text = 'Y' , width = 6, command = lambda : press('Y')) + Y.grid(row = 7 , column = 8, ipadx = 6 , ipady = 10) + + P = ttk.Button(text = 'P' , width = 6, command = lambda : press('P')) + P.grid(row = 7 , column = 9, ipadx = 6 , ipady = 10) + + X = ttk.Button(text = 'X' , width = 6, command = lambda : press('X')) + X.grid(row = 7 , column = 10, ipadx = 6 , ipady = 10) \ No newline at end of file diff --git a/src/layouts/SquareAlphabetic.py b/src/layouts/SquareAlphabetic.py new file mode 100644 index 0000000..2533bce --- /dev/null +++ b/src/layouts/SquareAlphabetic.py @@ -0,0 +1,113 @@ +import tkinter as tk +from tkinter import ttk + +hold = " " + +def press(char): + global hold + hold += char + +class SquareAlphabetic(tk.Tk): + + def __init__(self): + self.layout() + + + def layout(self): + A = ttk.Button(text = 'A' , width = 6, command = lambda : press('A')) + A.grid(row = 3 , column = 5, ipadx = 6 , ipady = 10) + + B = ttk.Button( text= 'B' , width = 6 , command = lambda : press('B')) + B.grid(row = 3 , column = 6 , ipadx = 6 ,ipady = 10) + + C = ttk.Button(text = 'C' , width = 6, command = lambda : press('C')) + C.grid(row = 3 , column = 7, ipadx = 6 , ipady = 10) + + D = ttk.Button(text = 'D' , width = 6, command = lambda : press('D')) + D.grid(row = 3 , column = 8, ipadx = 6 , ipady = 10) + + E = ttk.Button(text = 'E' , width = 6, command = lambda : press('E')) + E.grid(row = 3 , column = 9, ipadx = 6 , ipady = 10) + + exclamation = ttk.Button(text = '!' , width = 6, command = lambda : press('!')) + exclamation.grid(row = 3 , column = 10, ipadx = 6 , ipady = 10) + + + # SECOND ROW + F = ttk.Button(text = 'F' , width = 6, command = lambda : press('F')) + F.grid(row = 4 , column = 5, ipadx = 6 , ipady = 10) + + G = ttk.Button(text = 'G' , width = 6, command = lambda : press('G')) + G.grid(row = 4 , column = 6, ipadx = 6 , ipady = 10) + + H = ttk.Button(text = 'H' , width = 6, command = lambda : press('H')) + H.grid(row = 4 , column = 7, ipadx = 6 , ipady = 10) + + I = ttk.Button(text = 'I' , width = 6, command = lambda : press('I')) + I.grid(row = 4 , column = 8, ipadx = 6 , ipady = 10) + + J = ttk.Button(text = 'J' , width = 6, command = lambda : press('J')) + J.grid(row = 4 , column = 9, ipadx = 6 , ipady = 10) + + question = ttk.Button(text = '?' , width = 6, command = lambda : press('?')) + question.grid(row = 4 , column = 10, ipadx = 6 , ipady = 10) + + + # THIRD ROW + K = ttk.Button(text = 'K' , width = 6, command = lambda : press('K')) + K.grid(row = 5 , column = 5, ipadx = 6 , ipady = 10) + + L = ttk.Button(text = 'L' , width = 6, command = lambda : press('L')) + L.grid(row = 5 , column = 6, ipadx = 6 , ipady = 10) + + M = ttk.Button(text = 'M' , width = 6, command = lambda : press('M')) + M.grid(row = 5 , column = 7, ipadx = 6 , ipady = 10) + + N = ttk.Button(text = 'N' , width = 6, command = lambda : press('N')) + N.grid(row = 5 , column = 8, ipadx = 6 , ipady = 10) + + O = ttk.Button(text = 'O' , width = 6, command = lambda : press('O')) + O.grid(row = 5 , column = 9, ipadx = 6 , ipady = 10) + + comma = ttk.Button(text = ',' , width = 6, command = lambda : press(',')) + comma.grid(row = 5 , column = 10, ipadx = 6 , ipady = 10) + + + # FOURTH ROW + P = ttk.Button(text = 'P' , width = 6, command = lambda : press('P')) + P.grid(row = 6 , column = 5, ipadx = 6 , ipady = 10) + + Q = ttk.Button(text = 'Q' , width = 6, command = lambda : press('Q')) + Q.grid(row = 6 , column = 6, ipadx = 6 , ipady = 10) + + R = ttk.Button(text = 'R' , width = 6, command = lambda : press('R')) + R.grid(row = 6 , column = 7, ipadx = 6 , ipady = 10) + + S = ttk.Button(text = 'S' , width = 6, command = lambda : press('S')) + S.grid(row = 6 , column = 8, ipadx = 6 , ipady = 10) + + T = ttk.Button(text = 'T' , width = 6, command = lambda : press('T')) + T.grid(row = 6 , column = 9, ipadx = 6 , ipady = 10) + + period = ttk.Button(text = '.' , width = 6, command = lambda : press('.')) + period.grid(row = 6 , column = 10, ipadx = 6 , ipady = 10) + + + # FITH ROW + U = ttk.Button(text = 'U' , width = 6, command = lambda : press('U')) + U.grid(row = 7 , column = 5, ipadx = 6 , ipady = 10) + + V = ttk.Button(text = 'V' , width = 6, command = lambda : press('V')) + V.grid(row = 7 , column = 6, ipadx = 6 , ipady = 10) + + W = ttk.Button(text = 'W' , width = 6, command = lambda : press('W')) + W.grid(row = 7 , column = 7, ipadx = 6 , ipady = 10) + + X = ttk.Button(text = 'X' , width = 6, command = lambda : press('X')) + X.grid(row = 7 , column = 8, ipadx = 6 , ipady = 10) + + Y = ttk.Button(text = 'Y' , width = 6, command = lambda : press('Y')) + Y.grid(row = 7 , column = 9, ipadx = 6 , ipady = 10) + + Z = ttk.Button(text = 'Z' , width = 6, command = lambda : press('Z')) + Z.grid(row = 7 , column = 10, ipadx = 6 , ipady = 10) \ No newline at end of file