Zettelkasten-Team / Zettelkasten

Zettelkasten-Developer-Builds
http://zettelkasten.danielluedecke.de
GNU General Public License v3.0
735 stars 94 forks source link

Keyboard Shortcut for 'Show Random Note' is not working #373

Closed mateusbraga closed 2 years ago

mateusbraga commented 3 years ago

Describe the bug Keyboard Shortcut for 'Show Random Note' is not working. I press Ctrl+# and nothing happens.

Ctrl+'-' works, but Ctrl+'+' doesn't as well

To Reproduce Steps to reproduce the behavior:

  1. Open the program.
  2. Press Ctrl+#

Expected behavior After pressing Ctrl+#, I expected to move to a Random Note. The same way when I click on 'Show Random Note' in the Find menu.

Version information (please complete the following information): Zettelkasten-Version: 3.3.1 (Build 78d6775) Windows 10 10.0 (amd64) Java-Version 1.8.0_242 (AdoptOpenJDK) C:\Program Files\AdoptOpenJDK\jre-8.0.242.08-hotspot

Log information No error message in the logs.

RalfBarkow commented 3 years ago

@mateusbraga Thank you for this bug report.

RalfBarkow commented 3 years ago

zettelkasten-settings.zks3 > acceleratorKeysMain.xml

<key action="showRandomEntry">control BACK_SLASH</key>
RalfBarkow commented 3 years ago

@mateusbraga What does your zettelkasten-settings.zks3 > acceleratorKeysMain.xml file say? What is your key for the showRandomEntryaction?

RalfBarkow commented 3 years ago

src/main/java/de/danielluedecke/zettelkasten/database/AcceleratorKeys.java: numbersign = "BACK_SLASH";

mateusbraga commented 3 years ago

Where can I find the zettelkasten-settings.zks3?

RalfBarkow commented 3 years ago

Where can I find the zettelkasten-settings.zks3?

@mateusbraga Same directory as the application is stored, or in a sub-directory of the user's home dir.
Check for a subdirectory ".Zettelkasten" in your user's home directory.
Or search for zettelkasten-settings.zks3.

mateusbraga commented 3 years ago

Thanks. It is <key action="showRandomEntry">control NUMBER_SIGN</key>

RalfBarkow commented 3 years ago

How can we test this? See also "Testing Swing Code" #288 and "Separate business logic from visual components" #344

mateusbraga commented 3 years ago

I am not familiar with the codebase, so I will leave writing the test for someone else.

I have a question that can help us identify the bug:

My plan is to swap the action for Ctrl+'-', which I know is working, with the one in Ctrl+'#'. If still only Ctrl+'-" works, the problem is with the accelerator key code otherwise with the show random note code.

RalfBarkow commented 3 years ago

@mateusbraga Sounds like a good idea. You are welcome to try to modify the unpacked xml file accordingly. (Make backup) After you have modified it, you replace the acceleratorKeysMain.xml file in the zip archive zettelkasten-settings.zks3. Restart Zettelkasten and report back if you like.

mateusbraga commented 3 years ago

I edited acceleratorKeysMain.xml inside zettelkasten-settings.zks3, but it is as if the program doesn't read it. Nothing changed. The keyboard shortcut I changed kept doing the same thing when I started Zettelkasten again.

RalfBarkow commented 3 years ago

@mateusbraga Since I want to concentrate on a possible release 3.2.8 at the moment (and don't plan any bugfixes etc. for 3.3.1 before that), I would like to ask you to check the current build (main branch) to see if the problem you reported (still) exists there as well. See https://github.com/Zettelkasten-Team/Zettelkasten/actions showing runs from all workflows and choose the suitable artifact from the latest main branch build, e.g., from https://github.com/Zettelkasten-Team/Zettelkasten/actions/runs/1410262565#artifacts

mateusbraga commented 2 years ago

I downloaded a recent, main-branched artifact and the problem still exists.

Question, what is the different between 3.2.8 and 3.3.1?