Giter Site home page Giter Site logo

Comments (6)

Bogdanp avatar Bogdanp commented on June 23, 2024

This used to be the default, but I dropped it because framework takes a couple seconds to load, so it was annoying when writing small tools. I agree that not having those keybindings is also annoying in its own right, though. Would you be willing to add some of the basic keybindings for your platform to "gui/easy/private/view/keymap.rkt"? If not, I can probably take care of it later this week.

from racket-gui-easy.

cloudrac3r avatar cloudrac3r commented on June 23, 2024

Oh, that's interesting. I've never personally noticed that framework takes additional time to load, but I believe you.

Would you be willing to add some of the basic keybindings for your platform to "gui/easy/private/view/keymap.rkt"?

I can test on Linux and Windows. I'll take a look and see what I can do!

from racket-gui-easy.

cloudrac3r avatar cloudrac3r commented on June 23, 2024

I came up with this for my Linux computer:

(case (system-type 'os)
  [(macosx)
   (add&map "c:a" 'goto-start (λ (editor _event)
                                (send editor set-position 0)))
   (add&map "c:e" 'goto-end (λ (editor _event)
                              (send editor set-position (send editor last-position))))
   (add&map "d:a" 'select-all (λ (editor _event)
                                (send editor do-edit-operation 'select-all)))]
  [(unix)
   (add&map ":c:a" 'select-all (λ (editor _event)
                                (send editor do-edit-operation 'select-all)))
   (add&map ":c:z" 'undo (λ (editor _event)
                          (send editor do-edit-operation 'undo)))
   (add&map ":c:Z" 'redo (λ (editor _event)
                            (send editor do-edit-operation 'redo)))
   (add&map ":c:x" 'cut (λ (editor _event)
                         (send editor do-edit-operation 'cut)))
   (add&map ":c:c" 'copy (λ (editor _event)
                          (send editor do-edit-operation 'copy)))
   (add&map ":c:v" 'paste (λ (editor _event)
                           (send editor do-edit-operation 'paste)))])

However, undo and redo don't seem to fully work. I think the keybinds are activating but the editor is not recording the undo/redo history correctly, and I need to go to bed rather than debugging this right now. It would also be a nice-to-have if Ctrl+Left, Ctrl+Right, Alt+Left, Alt+Right moved the cursor backward and forward one word, which there doesn't seem to be a built in method for. At least cut/copy/paste all work.

from racket-gui-easy.

Bogdanp avatar Bogdanp commented on June 23, 2024

I've pushed a change to incorporate your examples, and I think I got undo and redo working. I think the word movement commands probably can also be implemented using find-wordbreak, but I'll have to look at that some other time.

from racket-gui-easy.

Bogdanp avatar Bogdanp commented on June 23, 2024

I've pushed another update to support moving backward and forward by word. I think that covers the basics, but do let me know if one of the Windows/Linux bindings is wrong or if there are others we should add.

from racket-gui-easy.

cloudrac3r avatar cloudrac3r commented on June 23, 2024

Works great on Windows, great job :)

from racket-gui-easy.

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.