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

Control + S shortcut is not passed to Qt Creator in non-insertion mode #24

Open
serpheroth opened this issue Feb 16, 2014 · 23 comments
Open
Labels

Comments

@serpheroth
Copy link

Control + S shortcut is not passed to Qt Creator in non-insertion mode under Linux.
In Mac, if I press Command + S and file is not changed, fakevim behaves like only key 's' is pressed. It deletes the character under cursor and goes into insertion mode. If there is file change unsaved, it will save the file.

@hluk hluk added the bug label Feb 16, 2014
@hluk
Copy link
Owner

hluk commented Feb 16, 2014

If I press Ctrl+S in FakeVim, file is not saved but nothing happens -- i.e. s command is not triggered either.

@serpheroth
Copy link
Author

Did you test it under Linux or Mac? If it is Linux, nothing happens. In Mac, fakevim interprets Command + s (not ctrl + s) as 's' command.

@hluk
Copy link
Owner

hluk commented Feb 16, 2014

Yup, I've tested it under Linux. It seems that it checks Ctrl but not Command key. Also I wonder why it's not treated as shortcut.

@hluk
Copy link
Owner

hluk commented Feb 16, 2014

Patches here and here though they need a bit more testing.

@serpheroth
Copy link
Author

After I updated the fakevimhandler.cpp file to this version https://codereview.qt-project.org/#patch,sidebyside,78305,2,src/plugins/fakevim/fakevimhandler.cpp. The problem became worse in Mac. Some shortcuts, like EasyMotion shortcut <Ctrl+;> that previously can be catched in normal mode now can not be catched by EasyMotion.

@hluk
Copy link
Owner

hluk commented Feb 16, 2014

You'll have to use both patches in that order for this to work.

@serpheroth
Copy link
Author

Doesn't the second patch already contain the changes from the first patch? I downloaded the second patch, I saw the changes in the first patch is already in the second patch.

@hluk
Copy link
Owner

hluk commented Feb 16, 2014

If you downloaded the zip file, then the changes from both patches should be there.

@serpheroth
Copy link
Author

That is what I did

@hluk
Copy link
Owner

hluk commented Feb 17, 2014

Was at least the "<C-S> treated as s" issue fixes with the previous patch?

@hluk
Copy link
Owner

hluk commented Feb 17, 2014

The reason why shortcut <C-;> for EasyMotion plugin is "eaten" by FakeVim is that the shortcut generate text ; which can be handled by FakeVim.

This really needs to be solved because otherwise you won't be able to differentiate between <C-S-X> and <S-X>.

@serpheroth
Copy link
Author

after the patch the problem is even worse in Mac. Even if there is unsaved
change, fakevim always interprets cmd + s as s commad. before the patch, it
saves the file if there is unsaved change.
On Feb 17, 2014 4:39 AM, "Lukas Holecek" [email protected] wrote:

The reason why shortcut <C-;> for EasyMotion plugin is "eaten" by FakeVim
is that the shortcut generate text ; which can be handled by FakeVim.

This really needs to be solved because otherwise you won't be able to
differentiate between and .


Reply to this email directly or view it on GitHubhttps://github.com//issues/24#issuecomment-35241393
.

@hluk
Copy link
Owner

hluk commented Feb 17, 2014

Here is fix for <C-S> and s (and others).

If you can, please try mapping some non-US keys -- I've tested few non-latin characters which worked but I expect there to be some exceptions.

@serpheroth
Copy link
Author

I just tested it in Mac, the problem still exists. If there is unsaved change, fakevim saves the file. If there is no change in the file, fakevim interprets cmd + s as s command.

@hluk
Copy link
Owner

hluk commented Feb 17, 2014

You could uncomment this line and remove this one (sorry, long time nobody has used it) and post the standard output after <C-S> key press.

@serpheroth
Copy link
Author

The following output is from the case when there is unsaved change, and I press cmd +s
SHORTCUT OVERRIDE 16777249 PASSING: false
NO SHORTCUT OVERRIDE 16777249
SHORTCUT OVERRIDE 16777249 PASSING: false
NO SHORTCUT OVERRIDE 16777249
KEYPRESS 16777249 "" '!'
PLAIN MODIFIER
SHORTCUT OVERRIDE 83 PASSING: false
NO SHORTCUT OVERRIDE 83

the following is the output from the case when there is no change and I press cmd + s
SHORTCUT OVERRIDE 16777249 PASSING: false
NO SHORTCUT OVERRIDE 16777249
SHORTCUT OVERRIDE 16777249 PASSING: false
NO SHORTCUT OVERRIDE 16777249
KEYPRESS 16777249 "" '!'
PLAIN MODIFIER
SHORTCUT OVERRIDE 83 PASSING: false
NO SHORTCUT OVERRIDE 83
SHORTCUT OVERRIDE 83 PASSING: false
NO SHORTCUT OVERRIDE 83
SHORTCUT OVERRIDE 83 PASSING: false
NO SHORTCUT OVERRIDE 83
KEYPRESS 83 "s" 'S'

@hluk
Copy link
Owner

hluk commented Feb 17, 2014

I get the same output. I'll try to put some more useful debug info to the Input class later.

@pvaibhav
Copy link

pvaibhav commented Sep 3, 2018

Hello, is there an update? 4.5 years later this is still present in latest Qt Creator :(

@hluk
Copy link
Owner

hluk commented Sep 5, 2018

Hello, is there an update? 4.5 years later this is still present in latest Qt Creator :(

@pvaibhav I haven't updated the code in a while. You try opening an bug report for Qt Creator if it's not reported there.

@garanaveen
Copy link

A lot might have changed from 2014 to 2015.
QtCreator gives an option to "Pass Control Key" for FakeVim mode. (Tools -> Options -> FakeVim).
When you check that option Ctrl+s was passed to Qt.

@garanaveen
Copy link

Hello, is there an update? 4.5 years later this is still present in latest Qt Creator :(

Tools -> Options -> FakeVim -> Check "Pass Control Key" should do the trick.

@pvaibhav
Copy link

pvaibhav commented Oct 11, 2018

Unfortunately that doesn't help (on a Mac). Cmd + S still clears out the whole line, instead of saving the file if there are no unsaved changes.

@jlegeny
Copy link

jlegeny commented Oct 18, 2018

@pvaibhav one workaround is to put map S <Nop> into the vimrc file used by Qt Creator

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

No branches or pull requests

5 participants