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

libvmui.textinput() and desktop shell builtin don't support moving cursor with mouse. #1

Open
ThomasTheSpaceFox opened this issue Aug 27, 2017 · 5 comments

Comments

@ThomasTheSpaceFox
Copy link

The recently added general-use text input function does feature a movable cursor, but its only movable via the keyboard. the question is how to add mouse support without massively over-complicating it.

it would help the general usability of the calculator a bit, as well as any utilities that end up using libvmui.textinput() as well.

@ThomasTheSpaceFox
Copy link
Author

@SBTCVM/core-devs any ideas?

@pnelego
Copy link

pnelego commented Aug 28, 2017

ill take a look, is the issue in the current branch?

@ThomasTheSpaceFox
Copy link
Author

@wyatthuckaby yup. perhaps the size() method of pygame font objects might be of use? to determine the size of the characters. see pygame docs: (http://www.pygame.org/docs/ref/font.html#pygame.font.Font.size) the new calculator (calc.py) is the first utility to use it. (and its handy character mask feature) also, MK2-TOOLS.py has a test for it via the "textinput" argument.

@ThomasTheSpaceFox
Copy link
Author

ThomasTheSpaceFox commented Aug 29, 2017

i should also point out that the cursor is an actual vertical bar/space that is inserted into the a copy of the current string that is used for rendering. this will affect the position of characters a bit.

@ThomasTheSpaceFox ThomasTheSpaceFox changed the title libvmui.textinput() doesn't support moving curser with mouse. libvmui.textinput() and desktop shell builtin don't support moving cursor with mouse. Oct 2, 2017
@ThomasTheSpaceFox
Copy link
Author

Fixing this in the desktop shell builtin should not be much more work, given that the code actually functions the same way as libvmui.textinput() just with slightly modified event parsing, and a different rendering scenario...

ThomasTheSpaceFox pushed a commit that referenced this issue Feb 8, 2018
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