elfmz / far2l

Linux port of FAR v2
GNU General Public License v2.0
1.76k stars 171 forks source link

MacBook Pro M1 Big Sur: No way to select files/folders in panels #986

Open ail-man opened 3 years ago

ail-man commented 3 years ago

No physical Insert button on Apple MacBook Pro M1. Keyboard Layout: US English Trying to select file/folder in the panel in order to do something with them (copy/move/etc). Pressing Fn + Return on folder causes entering the folder. Pressing the same shortcut on file causes nothing. How to select files/folders?

FAR2L, version 2.3.0 (build 21/04/15-a28b547-alpha) Darwin arm64
Copyright (C) 1996-2000 Eugene Roshal, Copyright (C) 2000-2016 Far Group, Copyright (C) 2016-2021 Far People

macOS version:

Darwin ... 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64
elfmz commented 3 years ago

Is it GUI far2l, right? If so, please do following. Open terminal, type

export FAR2L_STD=-
far2l

and when far2l's window will open - press release Fn button 3 times, then Cmd button and Option button. Then just close far2l _by mouse and share log from terminal window.

ail-man commented 3 years ago

@elfmz, each button is pressed and released exactly 3 times in the order that you asked (Fn, Cmd, Option):

DeduceCodepages: unknown locale 'UTF-8'
argv[0]='far2l' g_strFarModuleName='/opt/homebrew/bin/far2l' translation_prefix='/opt/homebrew/'

WinPortInitRegistry: OK 
                        FixedFontLookup: _any='Apple Color Emoji' _known_good='PT Mono'
Font 12 x 22 . 1: 'PT Mono' - monospaced stable (integer)
OnInitialized: client size = 400 x 222
OnConsoleResized client size: 960 550
ExclusiveHotkeys::SetTriggerKeys: ctrl_left=0 ctrl_right=0 alt_left=0 alt_right=0 win_left=0 win_right=0
WinPortFSNotify('/Users/ail') - watching
WinPortFSNotify('/Users/ail') - watching
CommandLine::ShowBackground: done
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/incsrch/plug/incsrch.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/editcase/plug/editcase.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/tmppanel/plug/tmppanel.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/editorcomp/plug/editorcomp.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/inside/plug/inside.far-plug-mb'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/colorer/plug/colorer.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/calc/plug/calc.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/align/plug/align.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/drawline/plug/drawline.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/compare/plug/compare.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/autowrap/plug/autowrap.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/filecase/plug/filecase.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/SimpleIndent/plug/SimpleIndent.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/NetRocks/plug/NetRocks.far-plug-wide'
LoadPlugin: cache hit for '/opt/homebrew/lib/far2l/Plugins/multiarc/plug/multiarc.far-plug-mb'
STARTUP: 24676
OnKeyDown: raw=3f code=0 uni=0 ( ) ts=19922151 [now=19922155]
19:39:39: Debug: Unrecognised keycode 364
19:39:39: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 0 0 DOWN
OnKeyDown: raw=3f code=0 uni=0 ( ) ts=19922363 [now=19922368]
19:39:39: Debug: Unrecognised keycode 364
19:39:39: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 0 0 DOWN
OnKeyDown: raw=37 code=134 uni=0 ( ) ts=19924791 [now=19924796]
19:39:41: Debug: Unrecognised keycode 364
19:39:41: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 11 8 DOWN
OnKeyUp: raw=37 code=134 uni=0 ( ) ts=19924996
19:39:42: Debug: Unrecognised keycode 364
19:39:42: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 11 0 UP
OnKeyDown: raw=37 code=134 uni=0 ( ) ts=19925340 [now=19925353]
19:39:42: Debug: Unrecognised keycode 364
19:39:42: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 11 8 DOWN
OnKeyUp: raw=37 code=134 uni=0 ( ) ts=19925564
19:39:42: Debug: Unrecognised keycode 364
19:39:42: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 11 0 UP
OnKeyDown: raw=37 code=134 uni=0 ( ) ts=19925899 [now=19925902]
19:39:43: Debug: Unrecognised keycode 364
19:39:43: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 11 8 DOWN
OnKeyUp: raw=37 code=134 uni=0 ( ) ts=19926171
19:39:43: Debug: Unrecognised keycode 364
19:39:43: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 11 0 UP
OnKeyDown: raw=3a code=133 uni=0 ( ) ts=19927416 [now=19927420]
19:39:44: Debug: Unrecognised keycode 364
19:39:44: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 12 2 DOWN
OnKeyUp: raw=3a code=133 uni=0 ( ) ts=19927620
19:39:44: Debug: Unrecognised keycode 364
19:39:44: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 12 0 UP
OnKeyDown: raw=3a code=133 uni=0 ( ) ts=19927970 [now=19927972]
19:39:45: Debug: Unrecognised keycode 364
19:39:45: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 12 2 DOWN
OnKeyUp: raw=3a code=133 uni=0 ( ) ts=19928189
19:39:45: Debug: Unrecognised keycode 364
19:39:45: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 12 0 UP
OnKeyDown: raw=3a code=133 uni=0 ( ) ts=19928517 [now=19928520]
19:39:45: Debug: Unrecognised keycode 364
19:39:45: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 12 2 DOWN
OnKeyUp: raw=3a code=133 uni=0 ( ) ts=19928769
19:39:45: Debug: Unrecognised keycode 364
19:39:45: Debug: Unrecognised keycode 365
ConsoleInput::Enqueue: # 0 12 0 UP
GenerateConsoleCtrlEvent(2)
OnConsoleResized client size: 960 550
OnConsoleResized client size: 960 550
OnConsoleResized client size: 960 550
OnConsoleExitSync
OnKillFocus
ConsoleInput::Enqueue: # 0 0 0 UP
SudoAskpassServer::Thread finished
elfmz commented 3 years ago

Good, so suggested solution, can be altering Touchbar buttons set by pressing Fn - so it will include Ins and other missing keys. And if it looks ok to you, then, as i dont have hardware Mac, then i will need list of keys that needs such behaviour, beside Ins. And a little bit patience to test things i cant test myself)

ail-man commented 3 years ago

Sure. At the moment I need only Ins key, don't know so far about others. Do you need me to test some other particular keystrokes?

singalen commented 3 years ago

A workaround: use Shift-cursor keys.

ail-man commented 3 years ago

That works, thanks @singalen 👍

elfmz commented 3 years ago

Hmmm i just started to write code and bug appeared closed.. Anyway, Fn+ still looks right solution, and i'm looking now intently at photo of that keyboard: https://qph.fs.quoracdn.net/main-qimg-d51e12e8f5f912632b8782d9dd0833fa And i see there abscence of Home/End/PgUp/PgDown/Ins and.. strange Delete key. That appears at place of Backspace and called as delete. So what that key is actually doing, when it pressed?

singalen commented 3 years ago

The author closed it because he got a workaround, Shift-Down. It's not a 100% equivalent, but it's close enough. The Delete key on Mac acts as Backspace, and Fn-Delete acts as a PC Del.

elfmz commented 3 years ago

Understand, i just thinking which keys must be shown on touchbar instead of F in 'Fn-alternate' mode. Current suggestion is static const char s_titles_alternate[CONSOLE_FKEYS_COUNT] { "Ins", "Del", "Home", "End", "PageUp", "PageDown", "", "", "=", "-", "*", "/" }; And even if you say Delete serves both Backspace/Del, it looks correct to duplicate it in this set just for symmetry. May be something missing? I still have two blank places..

singalen commented 3 years ago

Honestly, everything except for Ins is perfectly available through standard keybindings: https://apple.stackexchange.com/questions/26930/how-can-i-achieve-page-up-and-page-down-in-os-x Not everyone is aware of those, though, as the popularity of the question shows us.

Still,= - / are perfectly available on a normal MacBook keyboard with a Shift, at least, in English layout, and the keys have the respective labels. I would question their necessity on the touchbar.

elfmz commented 3 years ago

In FAR NumLock's +/- has special meaning - pressing + opens selection filter dialog allowing to select files, pressing - - same to deselect. 'Usual' minus key doesnt do that magic. Is it available on Mac somehow?

singalen commented 3 years ago

Nope, they are not. That would be great, thank you.

ail-man commented 3 years ago

Sorry, @elfmz, that I closed the issue. The workaround, suggested by @singalen basically solved my problem, and I didn't think, that it would grow into the code change. So I reopened it now. Please do, what you wanted to do. 👍

elfmz commented 3 years ago

Check now please

ail-man commented 3 years ago

@elfmz, just reinstalled far2l from 5e397da Now I can see the Ins, Del, +, -, *, /, Home, End, PageUp and PageDown buttons on the TouchBar, when I press and release immediately Fn. But there are problems:

In general, for me it is almost impossible to use those new buttons :(

elfmz commented 3 years ago

Googling shows that Control + Space is default language switch but not FN. Also regarding other keys, its strange, cuz pressing Alt or Shift together with FN should not discard alternate icons. With control there is bug, however..

ail-man commented 3 years ago

https://support.apple.com/en-gb/guide/mac-help/mchlp1406/mac

Use the Fn key or the Globe key: If you set an option in Keyboard preferences to change input sources by using the Fn key or the Globe key (if available on the keyboard), press the key to display a list of your input sources, then continue pressing the key until the input source you want to switch to is selected. The list disappears automatically.

On my macOS Big Sur after reinstalling from scratch this option was enabled by default. Also keep in mind, that on new MacBooks the Fn key is also labeled as language switch. Just compare MacBook 16" Pro Fn key with the newest MacBook Pro M1 Fn Key - pay attention on the Globe label on the M1.

amurchick commented 2 years ago

I'm sorry, but I didn't see the reason in opening a new issue.

How to simulate insert key on mac (where no physical insert key) in this window for example? image

May be reserve some key combination as alias for insert?

elfmz commented 2 years ago

Well, new mac event doesn't have touchbar. So what about adding following 'synonyms' in this and similar menus: Ins == F7 , Del = F8? Will it be ok? Any possible conflicts?

amurchick commented 2 years ago

Well, new mac event doesn't have touchbar. So what about adding following 'synonyms' in this and similar menus: Ins == F7 , Del = F8? Will it be ok? Any possible conflicts?

  1. F7 confilicts with Make folder :)
  2. What about Del key - this exists on Mac (fn+delete on mac-book) - no reason do alias for it, imho.

As suggestion for insert aliasing:

lucianf commented 1 year ago

Apologies for resurrecting an old thread but was there a global alias created for Ins in the end?

I'm not able to use fn+return (it just does a regular return for me), and I've not been able to map Ins to a different shortcut - I'm looking specifically at the Location menu but the below didn't work. Am I missing something obvious?

[KeyMacros/Shell/CtrlI]
DisableOutput=0x1
FilePanels=0x1
PluginPanels=0x1
Sequence=Ins
OleksandrKucherenko commented 9 months ago

Apologies for resurrecting an old thread but was there a global alias created for Ins in the end?

[KeyMacros/Menu/CtrlI]
DisableOutput=0x1
FilePanels=0x1
PluginPanels=0x1
Sequence=Ins

to make it work with the latest far2l you should enable macros for MENU