Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Fix editor shortcuts on macOS; give Multiline editor more space #64

Merged

Conversation

totalgee
Copy link
Contributor

@totalgee totalgee commented Jul 4, 2018

  • set io.KeySuper properly in keyDown/Up callbacks, so that
    cut/copy/paste and other such functionality based on shortcut keys
    work on macOS. KeySuper key is used by imgui to implement this
    functionality (in a special case for macOS) -- for other platforms
    KeyCtrl is used.
  • allow more space in buffer for Multiline editor (previously, only
    128 new characters could be added or pasted into the editor each
    time it was active).
  • eliminate unnecessary extra allocation in SetClipboardTextFn --
    imgui will now always send a zero-terminated string.

- set io.KeySuper properly in keyDown/Up callbacks, so that
  cut/copy/paste and other such functionality based on shortcut keys
  work on macOS.  KeySuper key is used by imgui to implement this
  functionality (in a special case for macOS) -- for other platforms
  KeyCtrl is used.
- allow more space in buffer for Multiline editor (previously, only
  128 new characters could be added or pasted into the editor each
  time it was active).
- eliminate unnecessary extra allocation in SetClipboardTextFn --
  imgui will now always send a zero-terminated string.
@totalgee
Copy link
Contributor Author

totalgee commented Jul 4, 2018

This PR is to fix issues #65 and #66.

@totalgee
Copy link
Contributor Author

totalgee commented Jul 4, 2018

BTW, I chose 16kb extra buffer space somewhat arbitrarily (it happens to be the size used by the buffer in the imgui demo of InputTextMultiline). Also, you can see there is not really a better solution right now than just choosing some "good size", in this discussion: ocornut/imgui#1008.

@simongeilfus simongeilfus merged commit f5303b3 into simongeilfus:master Jul 5, 2018
@simongeilfus
Copy link
Owner

Thanks for this!

@totalgee
Copy link
Contributor Author

totalgee commented Jul 6, 2018

Thank you for merging...that was quick!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants