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

Event enhancements in Shoes #384

Open
IanTrudel opened this issue Nov 9, 2017 · 6 comments
Open

Event enhancements in Shoes #384

IanTrudel opened this issue Nov 9, 2017 · 6 comments
Assignees

Comments

@IanTrudel
Copy link
Collaborator

Some enhancements have been suggested in #383 to improve Shoes and empower Shoes users. Let's make a list of desirable events. Add your own suggestion here.

Shoes.app do
   resize do
      para "user has resized the window.\n"
      # rescale the app accordingly
   end
end
@IanTrudel
Copy link
Collaborator Author

We might consider the global event manager would handle keypress multiple keys and modifiers problem #47. Perhaps keypress block would pass an array containing all the key pressed at once, e.g. [control, alt, a], [control, shift, alt, w], [up, down], etc. This may require to ensure a consistent order to allow easy comparisons. Or we might consider updating the current keypress to handle multiple keys at the same time, such as up_left, down_right, etc.

irb(main):002:0> [:control, :shift, :alt, :w].join("_")
=> "control_shift_alt_w"

@ccoupe
Copy link

ccoupe commented Nov 18, 2017

Going to need some help with OSX: deprecated. I'm starting to really hate that word.
https://developer.apple.com/documentation/appkit/nsevent/modifier_flags?language=objc

@IanTrudel
Copy link
Collaborator Author

The good news is that it is not a priority and we might get away with updating the current keypress event. We might want to come up with a use case or stress test because it seems keypress on FreeBSD is working better than on Windows, e.g. some modifier combinations may not be handled on Windows.

@ccoupe
Copy link

ccoupe commented Nov 19, 2017

I suspect it's the apple manual entry thats being deprecated. On osx you get 5 modifiers. Internally I'll map to a Shoes C enum and expand shoes_app_click, shoes_app_motion and shoes_app_release with an extra parameter for the enum.

For shoes_app_keypress() , osx maps to the 3 that gtk uses. See KEY_STATE macro in config.h. Perhaps, there is an existing way the cmd,ctl,alt or an easy way.

ccoupe pushed a commit that referenced this issue Nov 20, 2017
* Additonal arg (see Tests/events/event1.rb) is an array of
  with :shift_key and/or :control_key symbols. Should not effect
  existing scripts that don't expect a fourth
* Alt key is swallowd by shoes or gtk themes - not going there
* Will effect many widgets with click proc's (image, svg, plot)
  when I gets to them
@ccoupe
Copy link

ccoupe commented Nov 20, 2017

We might consider the global event manager would handle keypress multiple keys and modifiers problem #47 ...

Very unlikely. Huge platform and hardware dependencies. Secondly what you think the global event manager does, should it exist, is different from mine.

ccoupe pushed a commit that referenced this issue Nov 21, 2017
* mucho fixing for #384 and #383
* Finally! may have fixed OSX check box issue
Conflicts:
	shoes/canvas.h
	shoes/ruby.h
ccoupe pushed a commit that referenced this issue Nov 23, 2017
* osx clicks callback into shoes like gtk - cosmetic
* event handler crashes for minbsd and xmavericks targets
  works for minlin and xwin7 - same code - major mystery
ccoupe pushed a commit that referenced this issue Nov 29, 2017
* tricky - I run afoul of the Shoes timing of events.
* if shoes_hash_debug was callable from the gdb command line
  It might make things a lot easier to debug, Would have to fix
  those TODO's.  Dump an array would be nice, too.
@IanTrudel
Copy link
Collaborator Author

Updating suggested code for resize event. A similar event could be available for when a window is moved around (with left and top parameters).

Shoes.app do
   resize do |width, height|
      para "user has resized the window with new size #{width}@#{height}.\n"
      # rescale the app accordingly
   end
end

@ccoupe ccoupe modified the milestone: 3.3.5 Dec 21, 2017
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