Skip to content

Commit

Permalink
Backport a patch for reline to fix AltGr on European keyboards
Browse files Browse the repository at this point in the history
  • Loading branch information
aifeelit committed Feb 18, 2022
1 parent 03ba056 commit 4542d38
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 75fe9759a4b9a5f6e47abcc63cf195163502d2e6 Mon Sep 17 00:00:00 2001
From: aycabta <[email protected]>
Date: Tue, 18 Jan 2022 06:10:06 +0900
Subject: [PATCH 08/10] The AltGr behaves exactly the same as Ctrl+Alt

On European keyboards.
---
lib/reline/windows.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb
index f064472..005c6c3 100644
--- a/lib/reline/windows.rb
+++ b/lib/reline/windows.rb
@@ -249,7 +249,7 @@ class Reline::Windows
# no char, only control keys
return if key.char_code == 0 and key.control_keys.any?

- @@output_buf.push("\e".ord) if key.control_keys.include?(:ALT)
+ @@output_buf.push("\e".ord) if key.control_keys.include?(:ALT) and !key.control_keys.include?(:CTRL)

@@output_buf.concat(key.char.bytes)
end
--
2.30.0.windows.1

3 changes: 3 additions & 0 deletions mingw-w64-ruby31/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ options=('staticlibs' 'strip')
source=("https://cache.ruby-lang.org/pub/ruby/${pkgver2%.*}/${_realname}-${pkgver2}.tar.xz"
0001-Add-C-ext-win32-dll_directory-as-an-alternative-to-f.patch
0002-Don-t-add-an-exe-file-manifest.patch
0008-The-AltGr-behaves-exactly-the-same-as-Ctrl-Alt.patch
ruby.ico
rubyw.ico)

Expand All @@ -30,13 +31,15 @@ source=("https://cache.ruby-lang.org/pub/ruby/${pkgver2%.*}/${_realname}-${pkgve
sha256sums=('7aefaa6b78b076515d272ec59c4616707a54fc9f2391239737d5f10af7a16caa'
'a50c81ab8c178689485257f8eaa70bd8184b878a798780084668f838912e2832'
'da079dbfdc3d4e1b976ed15d58244ed6e0df201ec829bead578fb4a7177b9cab'
'1bc411c524ce724d444abb380dba612ba3b78cf7da5398d90b7cffc3fdaa07fe'
'6c80ba2ca49840e387a08b7fedc6e7acd298ac2ec853155209efb2af20397b22'
'c30fb04ac0e88ba634daaa811a81ea5a75027646617b895acd14df9518a4a55a')

prepare() {
cd ${srcdir}/${_realname}-${pkgver2}
patch -p1 -i ${srcdir}/0001-Add-C-ext-win32-dll_directory-as-an-alternative-to-f.patch
patch -p1 -i ${srcdir}/0002-Don-t-add-an-exe-file-manifest.patch
patch -p1 -i ${srcdir}/0008-The-AltGr-behaves-exactly-the-same-as-Ctrl-Alt.patch
}

build() {
Expand Down

0 comments on commit 4542d38

Please sign in to comment.