I have two xkb layouts, and use Alt+Shift to toggle between them:
setxkbmap "fr,us" -option grp:alt_shift_toggle
However, when I press a shorcut which contains Alt+Shift, the shortcut isn't taken into account, and instead the layout switches. For example Alt+Shift+Left (which selects code to the matching closing paren in some editors), or Alt+Shift+% (which is search and replace in emacs, the % needing Shift on French keyboards).
This was not the case with XUbuntu 14.04 I think, but I switched to NixOs, and I now have this issue.
How can I configure
setxkbmap so that it switches layouts only when Alt+Shift is not part of a shortcut, i.e. upon releasing the keys and only if there wasn't another key pressed at the same time?