LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-06-2023, 03:05 AM   #1
rempas
Member
 
Registered: Apr 2021
Distribution: Arch (btw)
Posts: 80

Rep: Reputation: Disabled
Why can't you bind "Ctrl+m" and "Return (enter)" to different actions?


I don't know if I'm bad at searching for information on the internet (even tho I tried for the last 2-3 hours), but I'm not able to find how I can bind Ctrl+m and Return to different actions. I have found how I can "unbind" Ctrl+m but it also unbinds the Return key and I want to use it.

Why isn't this possible? Are these two "connected" or something like that? Is there a "hack" to achieve what I want?

If not, is this an "operating system" thing or something that I can create my own shell and/or terminal library and change?

EDIT:

I have tried the following:
Quote:
bindkey -r '^m'
This unbinds the "Ctrl+m" key as expected. However, "Return" does not work as well. Hence, my question about them been "connected".

Last edited by rempas; 11-06-2023 at 04:21 AM. Reason: Added what I tried
 
Old 11-06-2023, 04:02 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
you can use xev to see what kind of events were really generated. Also would be nice to know what did you try exactly.
 
1 members found this post helpful.
Old 11-06-2023, 04:17 AM   #3
lvm_
Member
 
Registered: Jul 2020
Posts: 984

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
If you mean bash keymap binding, then yes, it works on the character code level and therefore cannot distinguish key combinations which generate the same code like ^M and enter.
 
1 members found this post helpful.
Old 11-06-2023, 04:23 AM   #4
rempas
Member
 
Registered: Apr 2021
Distribution: Arch (btw)
Posts: 80

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
you can use xev to see what kind of events were really generated. Also would be nice to know what did you try exactly.
Thank you! I have modified the original text, so everyone can see it. I have used "xev" but it reports "Ctrl+m" as separate keys, so it isn't helpful here.
 
Old 11-06-2023, 04:23 AM   #5
rempas
Member
 
Registered: Apr 2021
Distribution: Arch (btw)
Posts: 80

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by lvm_ View Post
If you mean bash keymap binding, then yes, it works on the character code level and therefore cannot distinguish key combinations which generate the same code like ^M and enter.
Damn, that's sad. Thank you for the reply!
 
Old 11-06-2023, 04:33 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
Quote:
Originally Posted by rempas View Post
Thank you! I have modified the original text, so everyone can see it. I have used "xev" but it reports "Ctrl+m" as separate keys, so it isn't helpful here.
You can remap probably the Ctrl-M to something else on X level, so instead of Ctrl-M something else will be sent to the terminal/shell, therefore you can assign something else to it.
also you might find it useful: https://unix.stackexchange.com/quest...er-combination
 
1 members found this post helpful.
Old 11-06-2023, 05:53 AM   #7
rempas
Member
 
Registered: Apr 2021
Distribution: Arch (btw)
Posts: 80

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
You can remap probably the Ctrl-M to something else on X level, so instead of Ctrl-M something else will be sent to the terminal/shell, therefore you can assign something else to it.
also you might find it useful: https://unix.stackexchange.com/quest...er-combination
Thank you! If it's something that is happening in the X11 (or Wayland in my case), I may indeed be able to remap it! Have a nice day!
 
  


Reply

Tags
bindings, shell, terminal



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ctrl+c and ctrl+v and ctrl+a dont work fine after install Nvidia drivers eros1989 Linux - Software 5 03-05-2019 07:00 AM
[SOLVED] How to enable "CTRL+C" and "CTRL+V" in Terminal? hack3rcon Linux - Newbie 5 12-10-2016 09:47 AM
How to disable Ctrl+C, Ctrl+V, Ctrl+X in rdesktop? Aswathy Linux - Newbie 1 01-19-2011 06:22 PM
Recognizing ctrl+c,ctrl+l,ctrl+d in C programs leonardo6023 Programming 1 08-19-2009 09:23 AM
"Enter Key" not working, how to map "Enter Key" functionality to "F9" Key srinihi Linux - Newbie 1 04-03-2009 02:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration