Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable context menu key #9825

Closed

Conversation

NickWingate
Copy link
Contributor

Summary

Catch and pass context menu key to core (respective core patch: https://gerrit.libreoffice.org/c/core/+/171914)
Once rendered context menu, focus it so we can continue navigating it with the keyboard

TODO

  • ...

Checklist

  • I have run make prettier-write and formatted the code.
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

Allows keyboard navigation of context menu

Signed-off-by: NickWingate <[email protected]>
Change-Id: I1eeb0afa7447c42f60f86ce42e152ad3d65c6e58
When context menu key is pressed we now send the command
to core.

Signed-off-by: NickWingate <[email protected]>
Change-Id: Ic12c5f3837042556962fb563107d34a6c0c374a6
@pedropintosilva
Copy link
Contributor

pedropintosilva commented Aug 16, 2024

I think I have found a problem

  1. Open a document
  2. Press the menu key on your keyboard
  3. Press down key -> it selects Paste
  4. Press Enter
  5. Press Escape (doesn't work but the escape works on this very dialog when the dialog is triggered from the UI or via ctrl + shift + alt + v) first Problem
  6. Click cancel
  7. See the Exception TypeError: operation is null emitting event contextmenu: second problem
09:18:58.911 1723792738912 INCOMING: invalidatecursor: { "viewId": "4", "rectangle": "2305, 1418, 0, 276", "mispelledWord": "0", "hyperlink": {} } global.js:529:37
09:18:58.912 Error in parsing value for 'top'.  Declaration dropped. cool.html
09:18:59.010 1723792739011 OUTGOING: key type=up char=0 key=1027
 global.js:529:37
09:19:00.042 1723792740042 OUTGOING: key type=input char=0 key=1305
 global.js:529:37
09:19:00.060 1723792740061 INCOMING: contextmenu: {
    "menu": [
        {
            "text": "~Cut",
            "type": "command",
            "command": ".uno:Cut",
            "enabled": "false"
        },
        {
            "text": "Cop~y",
            "type": "command",
           <truncated 15771chars> global.js:529:37
09:19:00.065
Exception TypeError: operation is null emitting event contextmenu: {
    "menu": [
        {
            "text": "~Cut",
            "type": "command",
            "command": ".uno:Cut",
            "enabled": "false"
        },
        {
            "text": "Cop~y",
            "type": "command",
            "command": ".uno:Copy",
            "enabled": "false"
        },
        {
            "text": "~Paste",
            "type": "command",
            "command": ".uno:Paste",
            "enabled": "true"
        },
        {
            "text": "Paste ~Special",
            "type": "menu",
            "command": ".uno:PasteSpecialMenu",
            "menu": [
                {
                    "text": "~Unformatted Text",
                    "type": "command",
                    "command": ".uno:PasteUnformatted",
                    "enabled": "true"
                },
                {
                    "text": "~More Options...",
                    "type": "command",
    

console-export-2024-8-16_9-22-29.txt

Peek.2024-08-16.09-22.mp4

Then after closing that dialog and refreshing:

  • The context menu now appears always following the position of the mouse cursor (arrow) instead of text cursor (caret) Third problem:
Peek.2024-08-16.09-23.mp4

@NickWingate
Copy link
Contributor Author

@pedropintosilva, I am unable to reproduce the first two problems. Working on a fix for the third problem now.

@pedropintosilva
Copy link
Contributor

Hey @NickWingate I have reassigned this to @codewithvk I hope that's ok, it would be sad to don't leverage the nice work you have already done there.

171914: Enable context menu key in online | https://gerrit.libreoffice.org/c/core/+/171914

@codewithvk
Copy link
Contributor

Created New PR : #10473

@codewithvk codewithvk closed this Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Menu key should trigger right click menu
4 participants