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

Missing AltGraph Key and hanging ctrl after ralt #530

Open
gerhard-h opened this issue Apr 26, 2022 · 8 comments
Open

Missing AltGraph Key and hanging ctrl after ralt #530

gerhard-h opened this issue Apr 26, 2022 · 8 comments

Comments

@gerhard-h
Copy link

gerhard-h commented Apr 26, 2022

On Windows in many languages RAlt is replaced by AltGr

  1. Most programs will accept AltGr emulation by doing LCTL + LALT but some do not.

    Windows Terminal will not accept A-C-7,A-C-8, A-C-9 for keys { [ ]
    C-A-7 RA-7 will also not work
    also waiting didn't help (around alt (around ctl #(P50 7 P50)))

  2. i have ralt on defsrc but after pressing it, ctrl keeps in the down state here is the log ```

Received event: Press <ctl>
Running hooks
Registering untimed hook: 28
Emitting: Press <ctl>

--------------------------------------------------------------------------------
Received event: Press <ralt>
Running hooks
Registering untimed hook: 29
Registering untimed hook: 30
Emitting: Press <ralt>

--------------------------------------------------------------------------------
Received event: Release <ralt>
Running hooks
Registering untimed hook: 31
Emitting: Release <ralt>
@MuhammedZakir
Copy link
Contributor

Please post your config, and which versions of Windows and KMonad are you using?

  1. Is this KMonad's problem? Sorry, I don't understand what you meant.

  2. Are you telling that when you press ralt, you are getting Pctl Pralt Rralt instead of Tralt?

* Px = Press x, Rx = Release x, Tx = Tap x (short for Px Rx)

@gerhard-h
Copy link
Author

Hi, Tanks for the quick reply and sorry for linking to Wikipedia https://en.wikipedia.org/wiki/AltGr_key but the article explains that AltGr is a different concept then RALT and the limitations of CTL+ALT as ALTGr emulation.

  1. Problem { [ ] are not available in windows terminal
  2. Problem ralt is emitting Pctl and Pralt on press, but only Rralt on release, this happens when I use the original RAlt button on my keyboard, when I map ralt to a non modifierbutton I also get Rctl

... maybe Kmonad tries to emulate AltGr, then an Option to not emulate it would be good

German keymap
Microsoft Windows 10 Enterprise
10.0.18363 Build 18363

kmonad.exe -V
0.4.1, commit 744c044

(defcfg
  ;; For Windows
     input  (low-level-hook)
     output (send-event-sink)
  fallthrough true

  ;; Set this to false to disable any command-execution in KMonad
  allow-cmd false
)

(defalias
  num  (layer-toggle numbers) ;; Bind num to a button that switches to a layer
  sym  (layer-toggle symbols) ;; Bind num to a button that switches to a layer
  ;;fsf (tap-next-release f lsft)  ;; long release does F 
  nsf (tap-hold-next-release 140 n rsft) ;; 200 was a good timing too
  fsf (tap-hold-next-release 140 f lsft)
  dct (tap-hold-next-release 140 d lctl)
  tct (tap-hold-next-release 140 t rctl)
  lat (tap-hold-next-release 240 l alt)
  bsl A-C-[
  rcb A-C-0
  lcb (around ralt #(P30 7 P30))   ;;C-A-7 11
  rsb A-C-8
  lsb A-C-9 
  mc2 #( P50 A-tab P50 )
  mus (tap-hold-next-release 500 spc @num)
)
#|
define 	; as  grv 
	ß as  [ 
	tick  ]
        ue as ;
	+  as =
to be able to map them on de keymap

Received event: Release <`>
Running hooks
Emitting: Release <k>

bug do not put backslash on defsrc
bug ralt won't release ctrl
bug mapping lmet to a layer still triggers the corresponding lmet+l = lock screen
bug ditto wont allow enter and must be restarted
|#
(defsrc
  esc  f1   f2   f3   f4   f5   f6   f7   f8   f9   f10  f11  f12        ssrq slck pause
  grv  1    2    3    4    5    6    7    8    9    0    [    ]    bspc  ins  home pgup  nlck kp/  kp*  kp-
  tab  q    w    e    r    t    y    u    i    o    p    ;    =    ret   del  end  pgdn  kp7  kp8  kp9  kp+
  caps a    s    d    f    g    h    j    k    l    grv  '    /                          kp4  kp5  kp6
  lsft 102d z    x    c    v    b    n    m    ,    .    -    rsft            up         kp1  kp2  kp3  kprt
  lctl lmet lalt           spc                 ralt KeyMenu   rctl       left down rght  kp0  kp.
)

(deflayer qwerty
  _    _    _    _    _    _    _    _    _    _    _    _    _          _    _    _
  _    _    _    _    _    _    _    _    _    _    _    _    del  _     _    _    _    _    _    _    _
  _    _    _    _    _    j    _    _    _    _    _    bspc del  _     _    _    _    _    _    _    _
  _    _    _    @dct @fsf _    _    @nsf @tct @lat k    ret  @bsl                      _    _    _
  _    @sym _    _    _    _    ralt m    ,    .    -    @lcb _                    _         _    _    _    _
  _    _    _              @mus                     ralt _    _          _    _    _    _    _
)

;; bug using caps as num eats one key in the layer definition
(deflayer numbers
  _    _    _    _    _    _    _    _    _    _    _    _    _          _    _    _
  _    _    _    _    _    _    _    _    _    _    _    _    _    _     _    _    _    _    _    _    _
  _    -    1    2    3    spc  esc  home up   end  _    _    _    _     _    _    _    _    _    _    _
  _    .    4    5    6    0    tab  left down rght _    _    _                         _    _    _
  _    _    ,    7    8    9    1    ret  bspc del  ret  _    _               _         _    _    _    _
  _    _    _              _                        _    _    _          _    _    _    _    _
)
(deflayer symbols
  _    _    _    _    _    _    _    _    _    _    _    _    _          _    _    _
  _    _    _    _    _    _    _    _    _    _    _    _    _    _     _    _    _    _    _    _    _
  _    _    _    @lcb @rcb _    _    _    @bsl  _    _    _    _    _     _    _    _    _    _    _    _
  _    _    _    @lsb @rsb _    _    _    _    _    _    _    _                         _    _    _
  _    _    _    _    _    _    _    _    _    _    _    _    _               _         _    _    _    _
  _    _    _              _                        _    _    _          _    _    _    _    _
)
#|
(deflayer name
  _    _    _    _    _    _    _    _    _    _    _    _    _          _    _    _
  _    _    _    _    _    _    _    _    _    _    _    _    _    _     _    _    _    _    _    _    _
  _    _    _    _    _    _    _    _    _    _    _    _    _    _     _    _    _    _    _    _    _
  _    _    _    _    _    _    _    _    _    _    _    _    _                         _    _    _
  _    _    _    _    _    _    _    _    _    _    _    _    _               _         _    _    _    _
  _    _    _              _                        _    _    _          _    _    _    _    _
)
-------------------------------------------------------------------------- 
|#

@gerhard-h
Copy link
Author

gerhard-h commented Apr 27, 2022

workaround for windows terminal: Open Settings > Actions and delete the crtl+alt+7,... keybindings

bonus workaround for visual studio: run Kmonad as admin

may be this should be mentioned in the faq?

@slotThe
Copy link
Member

slotThe commented May 8, 2022

bonus workaround for visual studio: run Kmonad as admin

Definitely see #426

may be this should be mentioned in the faq?

Sure, contributions welcome!

@gerhard-h
Copy link
Author

The problem that AltGr presses and won't release lctl still persists, but I found a workaround:
map ralt to an alias #( lctl C-lalt )

@Diablo-D3
Copy link

It seems you really want around(lctrl C-lalt)

@gerhard-h
Copy link
Author

(around lctrl C-lalt) indeed looks better as an ralt replacement. #( lctl @layer) would still be the syntax for mapping ralt to somthing else.
(meanwhile kanata has a config options windows-altgr cancel-lctl-press for remapping and windows-altgr add-lctl-release for using ralt)

@okutavio
Copy link

okutavio commented Mar 11, 2024

Perhaps someone can explain. In Windows, using US English International keyboard, AltGr+e = é. You might also use Alt+Ctrl. However, in Microsoft Word, Wordpad and notepad, you need to use AltGr to get é. Otherwise, using Alt+Ctrl, you get €. (btw, adding shift does work either way for É) Supprisingly enough, you get é elsewere, such as LibreOffice, and even Excel and Powerpoint

My issue is that using ralt also outputs € instead of é for notepad and Word (É works). I wonder what's actually inside that AltGr key or why ralt is no actual replacement. Any suggestions?

In Word (no where else), Ctrl+apostrophe works as a deadkey. (notepad is still an issue)
And, just for the record, again, in Word only, Ctrl+Alt (or ralt) + other vowels might be shortcuts

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

5 participants