Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom button width (single, double, ...) #370

Closed
Letrab opened this issue Jul 20, 2015 · 2 comments
Closed

Custom button width (single, double, ...) #370

Letrab opened this issue Jul 20, 2015 · 2 comments

Comments

@Letrab
Copy link

Letrab commented Jul 20, 2015

Hi,

Thank you for this awesome plugin!
I will use it for a custom made cash register for a friend of mine.

But I have a question/suggestion:

Is it possible to give an custom layout key a width?
I am trying to make a numeric keyboard layout, with a 0 (zero) as wide as 2 buttons.
I can probably hack this in, but is there an easy way to do this? (Custom css to 'display' mapping table?)

Thanks in advance!
Kind regards.

@Letrab
Copy link
Author

Letrab commented Jul 20, 2015

Found the most easy way myself:

Add in the css:

.ui-keyboard-48 { width: [single width + 2x margin]em; }

As 48 is the Unicode value of the number 0. Easily to add for other buttons this way.

Other suggestion though:
A checkDecimal(); call when performing a backspace or clear operation.
Added this myself and this way, after e.g. a clear, it is possible to directly start with a decimal (. ,) action.

Thanks!

@Mottie
Copy link
Owner

Mottie commented Jul 20, 2015

Hi @Letrab!

Yes, all virtual keys have a class name of ui-keyboard- followed by a unicode value of the first-letter of the text (I might need to change this first-letter thing) or action key name (ref).

I see that using the clear key doesn't check the decimal and it isn't checked until after the user begins typing. The backspace works for me. I'll have a patch for the clear key pushed to the master shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants