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

Special keys can not be inserted on french keyboards #47

Closed
sebcaux opened this issue Jul 29, 2017 · 5 comments
Closed

Special keys can not be inserted on french keyboards #47

sebcaux opened this issue Jul 29, 2017 · 5 comments

Comments

@sebcaux
Copy link
Contributor

sebcaux commented Jul 29, 2017

Hi, I have found a very embarrasing problem... On my french keyboard it is impossible to insert char like : ~#{[|\^@]} . To insert theses chars, I need to press Alt Gr key that corresponding to Alt + Ctrl

To fix this, I modify the specialKey in TextEditorComponent::keyPressEvent :

    bool specialKey = (modifiers&(Qt::MetaModifier|Qt::ControlModifier))
            && ((modifiers!=(Qt::AltModifier|Qt::ControlModifier)) || text.at(0).isUpper());

I don't know if it is the right way.

@vadi2
Copy link
Contributor

vadi2 commented Aug 3, 2017

We've got feedback on this as well:

The new editor features in 3.3.1 are delightful! I spend much, much less time tabbing out to Sublime Text since it was introduced.

However, there is one nasty problem I've run into: The new editor seems to hate keyboard layouts with an AltGr key, rejecting any inputs made with it. I'm on a Finnish keyboard; backslashes, brackets, tildes, vertical pipes are all entered with AltGr key combinations - probably obvious how Lua could be tough without these! They worked perfectly fine in previous versions, and continue to in external programs. Inputting these characters still works in every other area of Mudlet, including when editing the trigger lines themselves - it is only in the new editor where these commands fail.

Edit: Alt codes (LAlt+KP60 for < for example) do not worth either. AltGr and Alt key combinations both fail only within the editor.

@gamecreature
Copy link
Member

Sorry for the late reaction (currently very busy doing nothing 😉)
I will embed the solution supplied above. I'm not 100% certain this is the correct way to do it.
But it doesn't seem to affect the rest, so I will commit a new version.

    bool specialKey = (modifiers&(Qt::MetaModifier|Qt::ControlModifier))
                  && ((modifiers!=(Qt::AltModifier|Qt::ControlModifier)) || (!text.isEmpty() && text.at(0).isUpper()));

I still have my doubts about the text.at(0).isUpper()..
Aren't there any modifiers keys that don't result in a non-upper key?

Please give me suggestions about this.
I don't know how to test this situation on my Mac..

@PureWhiteWings
Copy link

PureWhiteWings commented Aug 5, 2017

Note: The feedback quoted by vadi2 was mine on a forum.

'Aren't there any modifiers keys that don't result in a non-upper key?'

There are, in fact. I can't speak for many other layouts, but there are numerous inputs that can be made on the Finnish multilingual layout that result in lowercase inputs. None of those should affect my code in Lua (the main language I use within edbee), but it does exist.

I think that goes into 'potential minor annoyance' territory, rather than 'severly limits coding' however. I'm happy to help test solutions, however I realistically can.

@sebcaux
Copy link
Contributor Author

sebcaux commented Aug 9, 2017

No problems, it's the hard work of being maintener!

Yes it seems strange the isUpper(), but :

  • AltGr = Ctrl + Alt modifier flags
  • Ctrl + Alt + 6 = | in event->text()
  • Ctrl + Alt + E = in event->text()
  • Ctrl + Alt + A = A in event->text()
    So Ctrl + Alt + letter can still be used as shortcut.

@gamecreature
Copy link
Member

@sebcaux Thanks for the feedback!
That's indeed a good solution to keep the shortcuts working

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

No branches or pull requests

4 participants