Thread: Possible bug?
View Single Post
Old 09-14-2021, 04:43 PM   #84
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 872
Karma: 3501146
Join Date: Jan 2017
Location: Poland
Device: Various
Quote:
From reading the Qt windows platform code, it looks like a left Ctrl and right Alt should be detected as an AltGr if no altgr key exists. Of course, I have not tried that at all!
The real problem with AltGr is that it is treated as Ctrl+Alt.
Imagine you have the shortcut AltGr+4=€
I can also get it by pressing Ctrl+left Alt+4.
But ... in Sigil, adding an environment variable or parameter -platform windows:altgr makes us sort of separate these two things from each other and thus:
AltGr works normally and is used to obtain additional characters (usually diacritics), and all shortcuts from Ctrl+left Alt can be used for keyboard shortcuts.

I didn't add the code, I just added a checkbox to the src\Form_Files\PKeyboardShortcutsWidget.ui file (as demo mockup).

Changed fragment:
Spoiler:
Code:
   <item>
    <layout class="QHBoxLayout">
     <item>
      <widget class="QPushButton" name="resetAllButton">
       <property name="toolTip">
        <string>Reset all to default</string>
       </property>
       <property name="text">
        <string>Reset All</string>
       </property>
      </widget>
     </item>
     <item>
      <spacer>
       <property name="orientation">
        <enum>Qt::Horizontal</enum>
       </property>
       <property name="sizeHint" stdset="0">
        <size>
         <width>40</width>
         <height>20</height>
        </size>
       </property>
      </spacer>
     </item>
     <item>
      <widget class="QCheckBox" name="EnableAltGr">
       <property name="text">
        <string>Enable AltGr on international keyboard</string>
       </property>
      </widget>
     </item>
    </layout>
   </item>



EDIT: I already have a working code.

Last edited by BeckyEbook; 09-14-2021 at 05:51 PM.
BeckyEbook is offline   Reply With Quote