Portion Selection With Keyboard?

@emre, what would it take to add either or both of:

  • shortcut key mapping to Ask Question Buttons (via button-configuration)
  • simple but automatic Tab Index to each of the Buttons

For example, using Tab key, we can tab-into the button area, but individual button tab-index is not available, nor is selection via spacebar or enter key …

If we could at least Tab through the buttons, then use Enter or Space for selection, that would suffice.


Or if we could assign shortcuts somehow… this is the current button configuration syntax:

Maybe something like this syntax could work:

[Caption]=[Parameter]:[Hover Color];[Button Color]:[shortcutKey]
3 Likes

@QMcKay thank you very much for the great idea. That is a little more complex than it seems as we intentionally disallow buttons to capture keyboard focus to make keyboard / barcode scanning work fine on ticket screen for single point touchscreens. I don’t think optimizing SambaPOS for keyboard use or improving screens by assuming there is no touch screen is a different case and this is not in my near future plans.

I feel like what really needed here is assigning barcodes to portions but I’m also not sure if it is something useful in general.

2 Likes

I am happy to work on a solution based on the previous script for @eminentcoder if/when he does upgrade to v5
Thinking disable current autoselect, if numberpad < 5 (or max number of portion options), select last order, update order portion using script to call relevant portion.

Assigning barcodes to portions is definitely gonna solve our problem but it’s just me, still using normal screens not touch one’s. So I hope and will wait for other people like me to ask for this feature.

Thanks @JTRTech for your help. Yesterday I tried to learn using scripts in Samba. Couldn’t find a tutorial. Tried your code a little bit. I could get the portion name. Or array of portions. But I couldn’t use the length property of array to find the no of portions returned in the array.
So I had to use break statement and iterate the loop 10 times.

}

I could also have used join method to concatenate all those portions as a string I think. But the problem now is, How can I present this to the user along with a keypad to enter portion index.
And also if I could show the prices of portions as well to the operator but that’s not that necessary.

My thought was not to display a list of options but that they entered the barcode then pressed 1 for full portion.
I was working on the presumption you have the ‘barcodes’ writen on menu next to the dishes and that you would add the portion numbers on that.

I would avoid a prompt without a touch screen, maybe update ticket title with the list/numbers for available portions of last order added.

Ya it’s fine. We have codes written on the menu for all products but not for portions. But that’s easy to put codes there. It would be enough for us till we upgrade to using Touch Screens.

If you could guide me a little as how to call this script in rules. So I can ask the operator for portion no and then use than no as index for this script.

Just some hints.

The script I originally gave would be good to start with.
You will want a new numberpad entered rule.
Give it a constraint of say numberpad is less than 10
For rules have select order action (to select the last order)
Update order action (use [:Portion] in the action so portion if available in the rule)
Then in the rule set call as {CALL:handler.function({NAME},[:NumberpadValue])

Would like to point out this is all theoretical as have not tested myself.
In theory it should push order name and numberpad value into the script and return the corresponding portion name into the portion field on the update order action.

Thanks a lot JTRTech. You saved me of making soooo many rules.

One more question: Aren’t all javascript methods and properties available in this scripting feature as I was unable to use length property to count no of portions. Or if I was doing some thing wrong.

Really appreciate your help.

I’ll upload my final screen shots here after implementing this.

Just to confirm; (dont expect it to work perfect first time…)

Probably a bit of both, its JScript rather than JavaScript and seem very similar but some differences I believe.
Also things like .length as mentioned above depend on the type of data, I was strugling to do a length but beleive it was because the query returned an object rather than array.
I know how to use it, thats not to say I fully understand it LOL

That returns a single string with Portions separated by commas.

Try portionList.split(',') to get your array, then .length should work.

var portions = portionList.split(',');

for (var p=0; p < portions.length; p++) {
  alert("Portion " + p + ":" + portions[p]);
}
1 Like

Hi @JTRTech,
I couldn’t accomplish this yet.
This is what I tried so far:
But I think Load Last Order action isn’t meant for what I am using it for. I don’t know how to select the last order.

This should work.

sql.Query('select * from Tickets').All.Length;

Thanks @emre. I’ll try more tomorrow. But I think I need to follow some more tutorials to understand Samba more. :sleeping:

Hoping for Barcode feature to be implemented for Product Portions as well. May I get some more votes from other fellows on the forum.

Another idea for V4 using ask parameters instead of portion button. It is not look good but should work with keyboard I haven’t tried.

We have drop down list for Ask parameter right. I think maybe just use arrow to select from the list.

Edit: Yes it work with keyboard. Just use arrow or type a letter or 2 will autocomplete portion name. For Diet Coke I use arror to select and enter. For Sprite, I type P then enter

2 Likes

hI @sukasem,

It worked for me. I am gonna upload the screen shots after a while.
What I did is add a rule for Order Added To Ticket and added actions for all products having portions more than one with action constraint.

But I am wondering now that if it would be possible to add only one action and add the portion parameters via SCRIPT.

1 Like

Wow, I have done it using scripts.
@sukasem, Finally I succeeded in implementing your idea with script provided by JTRTech . Thanks a lot…

Thanks All for helping me.

3 Likes