Giter Site home page Giter Site logo

Comments (4)

Ownmarc avatar Ownmarc commented on May 15, 2024 2

Those from labelimg are great (W for new annotation, A/D for previous/next image, "SPACE" to verify an image (should probably be something else since this tool is web based))

numbers for classes or simply let user assign the key he wants to the class he wants

from universal-data-tool.

Ownmarc avatar Ownmarc commented on May 15, 2024 1

Not exactly what you need, but it could help.. This is what I use to do things while key is pressed :

function useKeyPress(targetKey) {
  // State for keeping track of whether key is pressed
  const [keyPressed, setKeyPressed] = useState(false)

  // If pressed key is our target key then set to true
  function downHandler({ key }) {
    if (key === targetKey) {
      setKeyPressed(true)
    }
  }

  // If released key is our target key then set to false
  const upHandler = ({ key }) => {
    if (key === targetKey) {
      setKeyPressed(false)
    }
  }

  // Add event listeners
  useEffect(() => {
    window.addEventListener('keydown', downHandler)
    window.addEventListener('keyup', upHandler)
    // Remove event listeners on cleanup
    return () => {
      window.removeEventListener('keydown', downHandler)
      window.removeEventListener('keyup', upHandler)
    }
  }, []) // Empty array ensures that effect is only run on mount and unmount

  return keyPressed
}
const shiftPressed = useKeyPress('Shift')

{shiftPressed && (
          <Fragment>
            
          </Fragment>
)}

from universal-data-tool.

seveibar avatar seveibar commented on May 15, 2024 1

Thanks @Ownmarc! We're working on this issue this week! We were considering using the react-use useKey method.

Some of the keyboard shortcuts will be built into the library react-image-annotate.

@Ownmarc I was wondering what keyboard shortcuts, you'd like to see? If any?

from universal-data-tool.

puskuruk avatar puskuruk commented on May 15, 2024

You can look for the pr from here.

from universal-data-tool.

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.