lem-project / lem

Common Lisp editor/IDE with high expansibility
http://lem-project.github.io/
MIT License
2.4k stars 178 forks source link

strange behaviour with keyboard #373

Open vrx opened 5 years ago

vrx commented 5 years ago

hello, thanks for this very nice work !

I have succesfully bound shift-left and shift-right to move to windows (define-key global-keymap "Shift-Left" 'window-move-left) (define-key global-keymap "Shift-Right" 'window-move-right) but i can't get to do it with shift-up and shift-down (dont know why)

also i can't bind alt-left nor alt-right alt-left : gives me ȟ
alt-right: gives me Ȯ

I am using an azerty (french) keyboard.

best, v

snmsts commented 5 years ago

first of all the key bind work on the other software(like other editor on the terminal)? It sometimes taken by os or hotkeys.

vrx commented 5 years ago

thanks, i am on linux, those keys work fine in emacs.

snmsts commented 5 years ago

Would you share me more on your environment? (terminal app name and related envvar)

vrx commented 5 years ago

i tried on qterminal and gnome-terminal, same result as for the envvar here it is (i tried to guess what might be of interest) $ env LANG=en_US.UTF-8 DISPLAY=:0 LC_NAME=fr_FR.UTF-8 XDG_SESSION_ID=2 DESKTOP_SESSION=openbox
XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=openbox LC_ADDRESS=fr_FR.UTF-8 LC_NUMERIC=fr_FR.UTF-8 TERM=xterm-256color SHELL=/bin/bash GDMSESSION=openbox LC_IDENTIFICATION=fr_FR.UTF-8 LC_TIME=fr_FR.UTF-8

vrx commented 2 years ago

i still have this problem - any clue ?

in order to implement "control-down" to go to the next paragraph :

(define-key global-keymap "C-Down" 'forward-paragraph) doesn't work

(define-key global-keymap "Ȏ" 'forward-paragraph) works

cxxxr commented 2 years ago

This may have fixed it, what about? https://github.com/lem-project/lem/commit/c2e27480fbbb0037bf05a6dc4651dcdf97006fa8

vrx commented 1 year ago

unfortunately not really but it works much better with lem-sdl2 as a matter of fact with lem-sdl2, accentuated characters are not displayed properly i.e. when followed by any other character, lem inserts a space character (but when cursor is moved, the character reappears somehow) - looks like a confusion between size in bytes of a character and the real size it takes (the width of a single character) when displayed on screen

vrx commented 2 months ago

as a distant follow-up, i managed to get some characters (such as ~ # { [ etc) (with my french keyboard) in lem-sdl2 by disabling the right-alt key as a modifier

(defparameter *modifier-code-table*
  `((:shift ,sdl2-ffi:+kmod-lshift+ ,sdl2-ffi:+kmod-rshift+)
    (:ctrl ,sdl2-ffi:+kmod-lctrl+ ,sdl2-ffi:+kmod-rctrl+)
    (:meta ,sdl2-ffi:+kmod-lalt+); ,sdl2-ffi:+kmod-ralt+)
    (:super ,sdl2-ffi:+kmod-lgui+ ,sdl2-ffi:+kmod-rgui+)))

in frontends/sdl2/keyboard.lisp

I understand it's probably not the way it should be implemented but it kind of works...