Sk.inputfun customization

190 views
Skip to first unread message

simonts...@gmail.com

unread,
Jun 24, 2016, 9:54:34 AM6/24/16
to Skulpt
Hi!
I would like to customize the input javascript function. Could some please help me where to find this function for customization. (i am a beginner).

SimonT. 

Michael Cimino

unread,
Jun 29, 2016, 8:26:46 PM6/29/16
to Skulpt
The Sk.inputfun function is one of the optional functions passed to the Sk.configure function. The site that is using Skulpt defines what function Skulpt will use for input.

For example functions that can be used for Sk.inputfun, you can search for "Sk.inputfun" in the Skulpt repository, for example: https://github.com/skulpt/skulpt/search?utf8=%E2%9C%93&q=%22Sk.inputfun%22&type=Code

In the repository, for example, there is one example Sk.inputfun function defined on lines 184-186 of src/env.js 

Another example function can be seen on lines 37-39 of support/run_template.html

What kind of a custom input function are you looking to create?

- Michael Cimino

simonts...@gmail.com

unread,
Jul 10, 2016, 8:36:11 AM7/10/16
to Skulpt
Thanks Michael for your kind reply! 
      When you ask for user input e.g- raw_input("write here"), skulpt returns a javascript prompt box. Now, I have my own custom prompt fuction written in javascript/html/CSS and i am looking for replacing the prompt box that skulpt is using with my own prompt box function. Thus, I want to find the part of the code in skulpt responsible for the prompt box so that i can customize it.

simonts...@gmail.com

unread,
Jul 10, 2016, 8:40:07 AM7/10/16
to Skulpt
I think lines 184-186 that you specidied is responsible as it is returning the prompt() upon input....?
Reply all
Reply to author
Forward
0 new messages