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

Change universal key shortcut to insert bars #4526

Closed
wants to merge 4 commits into from

Conversation

lookitsnicholas
Copy link

@lookitsnicholas lookitsnicholas commented Aug 6, 2018

the Ins key is absent/non-functional on macOS devices, a change is necessary for this functionality to work

Edit by @tresf Closes #4522

@@ -315,7 +315,7 @@ void SongEditor::keyPressEvent( QKeyEvent * ke )
{
if( /*_ke->modifiers() & Qt::ShiftModifier*/
gui->mainWindow()->isShiftPressed() == true &&
ke->key() == Qt::Key_Insert )
ke->key() == Qt::Key_Enter )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to have a precompiler check for Mac here. We're not changing our default shortcut for all OSs. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or you can make two shortcuts with an ||.

{
m_song->insertBar();
}
#endif
Copy link
Member

@tresf tresf Aug 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I think you accidentally removed a curly bracket here.
  2. We use LMMS_BUILD_APPLE as our precompiler directive for MacOS.
  3. You should group the || logic with parens to be explicit.
  4. @LMMS/developers are there any objections to just removing the precompiler and doing ( ke->key() == Qt::Key_Insert || ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return) for all platforms?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I noticed that I accidentally removed the curly bracket - was planning on just creating a new PR.
We should probably test Return on macOS platforms before universally changing it, tho - if it doesn't work, Shift+D and Shift+I would be good options to fulfill the same purpose (as discussed previously).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there any objections to just removing the precompiler and doing[…] for all platforms?

No objections, sounds like a good idea. It's simpler and avoids confusion for people who switch platforms.

Copy link
Author

@lookitsnicholas lookitsnicholas Aug 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which key combos are we moving forward with? Alpha keys or function commands?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukas-w thanks. @lookitsnicholas I don't have an investment either way. I'll check in #general on Discord just to make sure. I'll tag you in the post.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we proceed with integrating this change into the master branch, then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. At this point this will be going into master. @tresf

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A thought just crossed my mind... has anyone actually tested these particular key combos on macOS? I'm currently running a build that @tresf graciously compiled for me, but it uses Shift+Command to insert bars instead of the designated key combos suggested here.

Copy link
Member

@tresf tresf Dec 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've since started using a Mac keyboard and the lack of delete shortcut is a huge hindrance. This PR is very similar. Any small shortcut changes that fix an OS-specific bug are fine in stable. It's unfortunate that the OP has abandoned the PR so if the best we can do is land it in master, oh well.

Copy link
Author

@lookitsnicholas lookitsnicholas Dec 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, I'm still here - also, Delete is Fn+Shift+Delete (pretty sure that we talked about this in the Discord chat); this PR just needs testing, which I can probably complete later today/tomorrow (wasn't able to setup my dev environment prior to macOS Mojave's GA)

@PhysSong
Copy link
Member

PhysSong commented Aug 6, 2018

Please use tabs for indentations instead of spaces. This is our coding convention.

@lookitsnicholas
Copy link
Author

lookitsnicholas commented Aug 6, 2018 via email

@tresf
Copy link
Member

tresf commented Aug 7, 2018

tabs were used, Xcode must encode them differently or smth

Each editor has its own preference when you hit the tab key. Even Qt Creator -- our preferred editor -- uses spaces by default, so this isn't uncommon.

@tresf
Copy link
Member

tresf commented Jan 11, 2019

@lookitsnicholas I'd love to see this in stable-1.2. I found a problem with compilation on Mojave and patched it here: #4767. Let me know if this makes it easier to test this feature.

@PhysSong
Copy link
Member

Superseded by #4851.

@PhysSong PhysSong closed this Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to add measure on macOS
6 participants