Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
SourceCoder 2.5 has long had a virtual calculator keypad that lets you type tokens via a familiar menu format rather than having to guess what SourceCoder uses for each token. It also makes typing unusual characters and symbols much easier. Unfortunately, it requires a good deal of initial work to transcribe the menu format into something that I can use via Javascript in SourceCoder. I'll be inserting the menus into the following Prizm-themed editor view:


If you hover over the buttons, you'll notice they're mapped to key codes (not necessarily the Prizm OS's keycodes, of course). The "top level" menu is a set of three-element rows, representing (normal), (with Shift/2nd), (with Alpha) outputs for each key. To borrow from the TI example:


This is the MATH/APPS/PRGM row of the keyboard. 13 is the sub-menu for MATH, 74 is APPS, 22 is PRGM, 27 is VARS. 2nd-MATH is the second element of the first row, 17; menu 17 is TEST. Likewise, 2nd-APPS is ANGLE, menu 21. Items in 'single quotes' are literal outputs, so the third column (ALPHA+key) is the literal A, B, or C typed. Items that are -1 indicate that that key combination does nothing. The Prizm has (norma), (shift), and (alpha) combinations.

That covers the top-level array. If someone could start in on that, it would rock. If it's necessary for me to do a few example keys first, I'd be more than happy to oblige.

The second-level menu arrays are much harder and much more intense. And because of the way Prizm menus work, making you press F6 to go to the next page, we will have a lot more of them. For example, here's the two pages of the MATH menu from the TI example:

menus[19] = new Array(
   'NAMES MATH',20,
   '1: [A]','~[A]',
   '2: [B]','~[B]',
   '3: [C]','~[C]',
   '4: [D]','~[D]',
   '5: [E]','~[E]',
   '6: [F]','~[F]',
   '7: [G]','~[G]',
   '8: [H]','~[H]',
   '9: [I]','~[I]',
   '0: [J]','~[J]'
menus[20] = new Array(
   'NAMES MATH',19,
   '1: det(','~det(',
   '2: {~T}','~{^T}',
   '3: dim(','~dim(',
   '4: Fill(','~Fill(',
   '5: identity(','~identity(',
   '6: randM(','~randM(',
   '7: augment(','~augment(',
   '8: Matr►list(','~Matr►list(',
   '9: List►matr(','~List►matr(',
   '0: cumSum(','~cumSum(',
   'A: ref(','~ref(',
   'B: rref(','~rref(',
   'C: rowSwap(','~rowSwap(',
   'D: row+(','~row+(',
   'E: *row(','~*row(',
   'F: *row+(','~*row+('

Notice that each menu row has two columns: first, the text to display, and second, the text to insert when that item is chosen, ie, a token. If the second column contains a number instead of a string, that's a menu to jump to when that item is chosen rather than inserting text. Makes sense? Smile
Oh man. I'll have to stare at this for a bit to understand it. But I have one question. Are the codes for "MATH" the getkey code? Or is that something entirely different? Such as menu numbers?

If they are the menu numbers, how do we go about coordinating? Just go down the keys from top left to bottom right and work the menu's up sequentially from there?

I'm lost in the code boxes and detailed explanation that I may be overlooking these answers :/
I misspoke, that's actually the MATRIX menu in the second codebox. The numbers in the first codebox are menu numbers; X in that becomes menus[x] = array(...) later, as shown in the second codebox. The menu numbers are in no particular order; I just kept counting up as needed, but we would indeed need to coordinate somehow.
*bump* Here's the key array and menu arrays for the top row of keys on the Prizm; hopefully it provides some clarification.


doF1(), -1, -1,      //F1
doF2(), 1, -1,      //F2, 1=ZoomMenu
doF3(),   2, -1,      //F3, 2=VWindow
doF4(), 3, -1,      //F4, 3=Sketch
doF5(), -1, -1,      //F5
doF6(), -1, -1,

zmenus[1] = array(
'Factor','~Factor ',

zmenus[2] = array(
'V-Win','~ViewWindow ',
'Store','~StoV-Win ',
'Recall','~RclV-Win ');

zmenus[3] = array(
'Tangent','~Tangent ',
'Norm','~Normal ',
'Inverse','~Inverse ',

zmenus[5] = array(
'[Sketch 2]',-1,
'Circle','~Circle ',
'Vertical',~Vertical ',
'Horz','Horizontal ',

zmenus[8] = array(
'[Sketch 3]',-1,
'Text','~Text ',

zmenus[4] = array(
'Y=','~Graph Y=',
'r=','~Graph r=',
'X=','~Graph X=',
'G⋅∫d𝓍','~Graph {int}',

zmenus[11] = array(
'[Graph 2]',-1,
'Y>','Graph Y>',
'Y<','Graph Y<',
'Y≥','Graph Y≥',
'Y≤','Graph Y≤',

zmenus[12] = array(
'[Graph 3]',-1,
'X>','Graph X>',
'X<','Graph X<',
'X≥','Graph X≥',
'X≤','Graph X≤',

zmenus[6] = array(
'Plot','~Plot ',
'PlotOn','~PlotOn ',
'PlotOff','~PlotOff ',
'PlotChg','~PlotChg ');

zmenus[7] = array(
'F-Line','~F-Line ');

zmenus[9] = array(
'On','~PxlOn ',
'Off','~PxlOff ',
'PxlChg','~PxlChg ');

zmenus[10] = array(
'NormalLine','~SketchNormal ',
'ThickLine','~SketchThick ',
'BrokenLine','~SketchBroken ',
'DottedLine','~SketchDot ',
'ThinLine','~SketchThin ');

*Double-bump* Tons more that I added! At least 112 menu screens at this point.


zmenus[13] = new Array(

zmenus[22] = new Array(
'[OPTN 2]',-1,

zmenus[28] = new Array(
'[OPTN 3]',-1,

zmenus[34] = new Array(
'[OPTN 4]',-1,

zmenus[14] = new Array(

zmenus[41] = new Array(
'[VARS 2]',-1,
'Str','~Str ',

zmenus[15] = new Array(

zmenus[49] = new Array(
'[PRGM 2]',-1,

zmenus[54] = new Array(
'[PRGM 3]',-1,

zmenus[16] = new Array(
'[SET UP]',-1,

zmenus[61] = new Array(
'[SET UP 2]',-1,

zmenus[67] = new Array(
'[SET UP 3]',-1,

zmenus[73] = new Array(
'[SET UP 4]',-1,

zmenus[79] = new Array(
'[SET UP 5]',-1,

zmenus[85] = new Array(
'[SET UP 6]',-1,

zmenus[17] = new Array(
'List','~List ',
'Dim','~Dim ',

zmenus[89] = new Array(
'[LIST 2]',-1,

zmenus[90] = new Array(
'[LIST 3]',-1,
'Sum','Sum ',
'Prod','Prod ',
'Cum1','Cum1 1',
'%','Percent ',
'ΔList','~ΔList ',

zmenus[18] = new Array(
'Mat','~Mat ',
'Det','~Det ',
'Trn','~Trn ',

zmenus[91] = new Array(
'[MAT 2]',-1,
'Dim','~Dim ',
'Ref','~Ref ',
'Rref','~Rref ',

zmenus[19] = new Array(
'Abs','~Abs ',
'Arg','~Arg ',
'Conjg','~Conjg ',

zmenus[92] = new Array(
'[COMPLEX 2]',-1,
'ReP','~ReP ',
'ImP','~ImP ',

zmenus[20] = new Array(

zmenus[93] = new Array(
'[CALC 2]',-1,

zmenus[94] = new Array(
'[CALC 3]',-1,
'Int','~Int ',
'Rmdr','~Rmdr ',
'Simp','~►Simp ',

zmenus[21] = new Array(

zmenus[96] = new Array(
'[STAT 2]',-1,

zmenus[23] = new Array(

zmenus[102] = new Array(
'[CONVERT 2]',-1,

zmenus[107] = new Array(
'[CONVERT 3]',-1,

zmenus[24] = new Array(
'sinh','~sinh ',
'cosh','~cosh ',
'tanh','~tanh ',
'sinh{^-1}','~sinh{^-1} ',
'cosh{^-1}','~cosh{^-1} ',
'tanh{^-1}','~tanh{^-1} ');

zmenus[25] = new Array(

zmenus[111] = new Array(
'Ran#','~Ran# ',

zmenus[112] = new Array(
'[PROB 2]',-1,

zmenus[26] = new Array(
'Abs','~Abs ',
'Int','~Int ',
'Frac','~Frac ',
'Intg','~Intg ',

zmenus[113] = new Array(
'[NUMERIC 2]',-1,
Keep it up! I still don't follow the pattern Sad
comicIDIOT wrote:
Keep it up! I still don't follow the pattern Sad
What can I help clarify? What makes sense and what doesn't? I'd love to be able to clarify it so that I could beg assistance from you and our other Prizm owners. Smile
Here's more, if it helps. Sad Projected is well over 150 now, so any assistance would be hugely appreciated.

zmenus[27] = new Array(

zmenus[114] = new Array(
'[ANGLE 2]',-1,

zmenus[29] = new Array(

zmenus[115] = new Array(
'[ENG-SYM 2]',-1,

zmenus[116] = new Array(
'[ENG-SYM 3]',-1,

zmenus[30] = new Array(
'Store','~StorePict ',
'Recall','~RclPict ');

zmenus[31] = new Array(

zmenus[32] = new Array(
'And','~ And ',
'Or','~ Or ',
'Not','~ Not ',
'Xor','~ Xor ');

zmenus[33] = new Array(
'Recall','~RclCapt ');

zmenus[35] = new Array(

zmenus[124] = new Array(
'[FINANCE 2]',-1,

zmenus[36] = new Array(

zmenus[37] = new Array(

zmenus[38] = new Array(

zmenus[39] = new Array(

zmenus[40] = new Array(
'Start','~D Start',
'End','~D End',
'Pitch','~D pitch');

zmenus[42] = new Array(
'Start','~F Start',
'End','~F End',
'Pitch','~F pitch',
'Result','~F Result');

zmenus[43] = new Array(
'Result','~R Result');

zmenus[44] = new Array(
'SimRes','~Sim Result',
'SimCoef','~Sim Coef',
'PlyRes','~Ply Result',
'PlyCoef','~Ply Coef');

zmenus[45] = new Array(

zmenus[142] = new Array(
'[FINANCE 2]',-1,

zmenus[46] = new Array(
'If','~If ',
'Then','~Then ',
'Else','~Else ',

zmenus[143] = new Array(
'[COMMAND 2]',-1,
'For','~For ',
'To','~ To ',
'Step','~ Step ',

zmenus[144] = new Array(
'[COMMAND 3]',-1,
'While','~While ',
'LpWhile','~LpWhile ',

zmenus[47] = new Array(
'Prog','~Prog ',

zmenus[48] = new Array(
'Lbl','~Lbl ',
'Goto','~Goto ',
'Isz','~Isz ',
'Dsz','~Dsz ',
'Menu','~Menu ');

zmenus[50] = new Array(
'List','~ClrList ',
'Mat','~ClrMat ');

zmenus[51] = new Array(

zmenus[52] = new ArraY(

zmenus[53] = new Array(
'Locate','~Locate ',

zmenus[147] = new Array(
'[I/O 2]',-1,
'S38k','~Send38k ',
'R38k','~Receive38k ',

zmenus[55] = new Array(

zmenus[148] = new Array(
'[STR 2]',-1,

zmenus[149] = new Array(
'[STR 3]',-1,

zmenus[56] = new Array(

zmenus[57] = new Array(

zmenus[58] = new Array(

zmenus[59] = new Array(

zmenus[60] = new Array(

zmenus[62] = new Array(
'Fix','~Fix ',
'Sci','~Sci ',
'Norm','~Norm ',

zmenus[63] = new Array(

zmenus[64] = new Array(

zmenus[65] = new ArraY(

zmenus[66] = new Array(
'Pict','~BG-Pict ');

zmenus[68] = new Array(

zmenus[69] = new Array(

zmenus[70] = new Array(
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum