Results 1 to 8 of 8

Thread: Inputs: pressing Enter and Tab

  1. #1

    Exclamation Inputs: pressing Enter and Tab

    Inputs are an awesome addition! But it feels like they're missing 2 basic interactions that inputs have in applications and on the internet: actions when you press Enter and when you press Tab.

    Enter is the more crucial of the 2. When you press enter, that's usually when you want your input to extract that string and make use of it. Currently, inputs call a function on a character per character basis, which is a good functionality to have, but not the first one that people would want from inputs.

    When you create an input, there should be few new parameters: "enter_function" would trigger whenever the player presses enter. "input_function" would be renamed to something like "per_character_function" and would trigger with every character entered, like "input_function" works currently.

    There would also be a new parameter called "next_input_id", which would indicate which input you'd switch to when you press Tab inside this one. Tab-switching between inputs is really useful when you have to enter lots of data in several fields, which good tools like the button visualizer do require.

    With both of those in, inputs would be really powerful.

  2. #2
    They already do. Enter is registered as newline in the string ('\n' character) and tab is registered as four spaces (added through one function call so you can know that it's tab and not just four spaces entered). You can implement the functionality you want very easily script side, aside from switching to next input as we have no control over player interaction (which would be useful, but probably in a more generic form).

  3. #3
    It is nice that we can interpret Tab and Enter presses but it is annoying that that very basic functionality isn't built-in for inputs. It's kind of having to reinvent the wheel every time you create an input (and yes you CAN make one function that interprets it and just call that for every input)

    I know it's being lazy but it's still something that is so basic to how we expect inputs to work (imo) that it should be included.

    And then yea, actual functionality allowing the input switching is something we need. I understand that Berserk is probably wary of including scripts to control another player's control methods, but in the case of input switching you kind of enter a different "state" when you're inputting characters, and allowing us control over which box they're typing in sems like it would be troll-proof.

  4. #4
    What if I *want* the ability to insert newlines (enters) and tabs in my text field? Just to format text, interpret them as in any other text field. Current system lets me do that and handle any additional functionality if I want to (do XXX if user enters tab).

    What you suggest would prevent us from entering tabs for good. What, we get another flag 'switch_on_tab'? What if someone wants to switch using arrow keys, or by entering < > ? IMO functionalities should be general and flexible. This would be exactly hardcoding some behaviors which isn't nice. I'm all from being able to redirect user to another text field (again, better something more general that would be able to do more stuff with UI for the user, like open notebook/menu etc. too), but solutions like that would actually limit us.

  5. #5
    If you used the "per_character_function" you'd still receive \n and tabs in your field. That parameter would be exactly the same as the current "input_function", it would only be renamed. So I don't see how you'd lose any functionality if you just used that and not the new "enter_function".

    I totally see how the current setup is a powerfull tool, and I don't want to change that. I just want a shortcut for a common use-case (and the addition to Tab-switching, which we agree on)

  6. #6
    Moved to Scripting Suggestions

  7. #7
    So suggestions that are only related to scripting should be posted to Scripting Suggestions? Coz iv posted plenty of suggestions w scripting b4 and want to know if that's why this one got moved

  8. #8
    Forum: Scripting

    Anything related to scripting in Tabletop Simulator. This includes suggestions and bugs related to scripted.

    If a Suggestion is predominantly concerning Scripting. Then yes. . .this is where it should be placed.

Similar Threads

  1. Replies: 1
    Last Post: 02-07-2017, 10:36 PM
  2. Replies: 0
    Last Post: 10-16-2016, 05:27 PM
  3. Randomize hands by pressing 'R'
    By Spheniscine in forum Suggestions
    Replies: 0
    Last Post: 06-09-2016, 09:23 AM
  4. Pressing enter in a text area adds two new lines
    By SmileyChris in forum Bug Reports
    Replies: 0
    Last Post: 04-06-2016, 05:55 PM
  5. Enter button does not work in tablet
    By Arcuate in forum Bug Reports
    Replies: 2
    Last Post: 02-22-2016, 04:13 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •