Coder Social home page Coder Social logo

Comments (3)

hodgef avatar hodgef commented on July 30, 2024 3

@omartoutounji Thanks for this info. I think you could achieve this with CSS.

Let's say you have this default layout:

[
  'c a z y x w v u',
  'd t',
  'e s'
  (etc..)
]

Then in CSS you'd target all the rows that are not the first nor the last one.
image

Perhaps like this

.simple-keyboard .hg-row:not(:first-child):not(:last-child) {
  justify-content: space-between;
}

.simple-keyboard .hg-row:not(:first-child):not(:last-child) .hg-button {
  flex-grow: unset;
  min-width: 50px;
}

Here's a sandbox:
https://codesandbox.io/s/2zx3my9qj0

Screenshot:

image

Regards,
Francisco Hodge

from simple-keyboard.

omartoutounji avatar omartoutounji commented on July 30, 2024 1

Hello @hodgef,

Thank you for your prompt reply.

We are trying to create iType, a website that allows you to type using your eye gaze which is tracked by your webcam. Fingers? Who needs them!

We tried 'eye-gazing' (as in typing by staring at a letter one-by-one for some time) on a QWERTY and it wasn't a pleasant experience as the letters are so close to each other. So to achieve a better user experience, we completely re-designed the QWERTY look to make it easier to type with your eyes.

We are now trying to implement that design using simple-keyboard, however empty spaces are replaced with empty buttons which we don't want.

Allow me to elaborate by attaching screenshots.

Below is the design we are trying to implement.
keyboarddesign

Below is our implementation so far with simple-keyboard
simplekeyboardimplementation

As you can see, those empty buttons look bad and the empty rows are clickable which we don't want!

from simple-keyboard.

hodgef avatar hodgef commented on July 30, 2024

Hello @omartoutounji,

Any character between spaces (even a space between spaces), is considered a button by design.

You could create an empty button like this {//} (built-in) or just create a custom empty button (like {empty}), then give it a desired style in CSS (though buttonTheme).

I'm not completely visualizing the use-case here though, a screenshot of what you're trying to achieve would really help. If padding between rows or buttons is needed, I generally would recommend using CSS.

Hope that helps. If it doesn't please provide a screenshot of what you're trying to achieve and we'll go from there.

Regards,
Francisco Hodge

from simple-keyboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.