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

Mobile support does not seem to work #52

Open
Deadbush225 opened this issue Sep 10, 2022 · 55 comments
Open

Mobile support does not seem to work #52

Deadbush225 opened this issue Sep 10, 2022 · 55 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Deadbush225
Copy link

The support for mobile (android) doesn't seem to work.

Recording

I tried it on both of my android devices but neither of them worked. I checked if other plug-ins caused that, so I made a fresh obsidian installation but it still has no effect.

Additional Details:

  • Live Preview editor is enabled
  • Lastest version is installed
  • Android version: 12
@artisticat1
Copy link
Owner

I don't have an Android device so I can't easily debug this.

  • Can you paste your debug info here? (Command palette -> Show debug info)
  • Do other features of the plugin work (conceal, color matching brackets)?
  • Does an older version of the plugin work? Try v1.3.0, it's the earliest version that is compatible with Obsidian v0.15 and newer. You can install older versions of the plugin using BRAT.

@Deadbush225
Copy link
Author

Sure, can do that.

This is the debug info:

SYSTEM INFO:
	Operating system: android 12 (vivo V2038)
	Obsidian version: 1.3.1 (65)
	API version: v0.15.9
	Login status: not logged in
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 1
	Plugins enabled: 1
		1: Latex Suite v1.4.3

RECOMMENDATIONS:
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Next, I can confirm that the conceal and color matching brackets are working.
Screenshot_2022_0910_202751

Lastly, The v1.3.0 didn't work, even the v1.4.0 to v1.4.2 had no luck.

Trying v1.3.0:

@artisticat1
Copy link
Owner

I see. The fact that the conceal and color matching brackets features are working means that the plugin is loading correctly, and CodeMirror extensions are working.

  • Do the auto-fraction, matrix shortcuts, and tabout features work?
  • Are you using the default snippets?
  • Could you install this dev tools plugin (https://github.com/KjellConnelly/obsidian-dev-tools) with BRAT? This will give us access to a console on mobile.
    After enabling the plugin, open a console using the Command palette. Then let me know whether you see any errors in the console when you enable Latex Suite, and when you try typing snippets.

@Deadbush225
Copy link
Author

Yes, I'm using the default snippets. In fact, I just discovered it then I found this issue. Unfortunately, I'm afraid auto-fraction, matrix shortcuts, and tabout features are not working.

Trying the said features with the dev tools console opened.
Screenrecording_20220911_170346

As you can see, I received no error while testing the features. Please let me know if you need further testing.

@artisticat1
Copy link
Owner

Hmm I see. Do you get any errors when you first enable the Latex Suite plugin?

It does seem strange that you get no errors. Please give me some time to put together a debug build and get back to you!

@Deadbush225
Copy link
Author

Do you get any errors when you first enable the Latex Suite plugin?

Sorry for the late reply. It sure was strange but I just double checked it, and I really didn't saw any errors after I enabled the Latex suite plug-in.

@proItheus
Copy link

proItheus commented Oct 1, 2022

@eliazar-sll Have you noticed the underline on what you typed? I think this is a problem about your input method . When you are typing , the input method actually hold the letters without passing it to obsidian . Only after you select a word or press something like space will it pass the letters you typed all at the same time to obsidian, and the underline disaopears . You can try using some input methods that directly pass your input to the target app ,hacker's keyboard etc.

@Deadbush225
Copy link
Author

Deadbush225 commented Oct 1, 2022

Your suggestion sounds very promising so I tried it with 2 different keyboards, each disabled their autocomplete functionalities

Hacker's Keyboard:
Record-2022-10-02-07-09-29.GIF

Simple Keyboard:
Record-2022-10-02-07-17-36.GIF

And as you can see, the underline disappeared but the problem still persists. Do you have any thoughts about this?

@proItheus
Copy link

Ah, It's a bit strange. I tried it by myself, and find almost all input methods on android won't work with latex suite... However, trime does work for me. I have no clue about why they work or not work though. Maybe something about input key event?

@artisticat1
Copy link
Owner

I've put together this debug build. It prints some console.log statements whenever the plugin detects a keypress.

obsidian-latex-suite-1.6.0-debug.zip

Can any android users test this build and upload a video of what appears in the console? It would be helpful if you did this using the different keyboards that do/do not work, described by @proItheus above.

@proItheus
Copy link

proItheus commented Oct 15, 2022

Sorry but how can I enable the console on obsidian android?

@Deadbush225
Copy link
Author

@proItheus Quoting from @artisticat1, I think this is the process of enabling console on obsidian

Could you install this dev tools plugin (https://github.com/KjellConnelly/obsidian-dev-tools) with BRAT? This will give us access to a console on mobile.

  • After enabling the plugin, open a console using the Command palette. Then let me know whether you see any errors in the console when you enable Latex Suite, and when you try typing snippets.

@Deadbush225
Copy link
Author

@artisticat1, I just tried the debug build and it logs The "Unidentified" key was pressed every time I press a key

Keyboard: Microsoft G-swift
video_20221015_212115_edit

@proItheus
Copy link

Confirmed that the plugin logs keydown normally for the trime keyboard mentioned above, while loging Unidentified key as @eliazar-sll finds for keyboards not working , that is , almost all other keyboards I can find for android ...

@artisticat1
Copy link
Owner

Thank you both! It appears that keypresses are not being transferred to the plugin correctly. I'll try to investigate this further.

@artisticat1
Copy link
Owner

Can you visit https://codemirror.net/try/ and paste the following code into the editor on the left hand side?

import {minimalSetup, EditorView} from "codemirror"
import {Prec} from "@codemirror/state";

const onKeydownExtension = Prec.highest(EditorView.domEventHandlers({
    "keydown": (event, view) => {
      console.log("The " + event.key + " key was pressed.");
    }
}));

new EditorView({
  doc: "...",
  extensions: [minimalSetup, onKeydownExtension],
  parent: document.body
})

(Erase the code contained in the editor by default.)

This code will set up a test editor with a debug statement that prints out keypresses the editor detects. Press the "Run" button after pasting in the code in order to initialise the test editor (which sits on the right hand side).

Then, in the editor on the right, type in some text. Then switch to the "Log" tab and let me know what it says.

@Deadbush225
Copy link
Author

Just tried it and this is the screen recording.
Record_2022-10-31-17-14-10.gif

And these are the logs, I noticed that it only detects the backspace and numerical keys.

The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Unidentified key was pressed.
The Unidentified key was pressed.
The Unidentified key was pressed.
The Unidentified key was pressed.
The Unidentified key was pressed.
The Unidentified key was pressed.
The Unidentified key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The 4 key was pressed.
The 8 key was pressed.
The 7 key was pressed.
The 4 key was pressed.
The 6 key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Unidentified key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Unidentified key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.
The Unidentified key was pressed.
The Backspace key was pressed.

@L0L1P0P1
Copy link

L0L1P0P1 commented Nov 7, 2022

try using some input methods that directly pass your input to the target app ,hacker's keyboard etc.

LaTex suite seems to work in android with an external keyboard. Yet it doesn't work at all in other circumstances.

@awsharif
Copy link

Hi @artisticat1, has there been any further investigation about this?

@artisticat1
Copy link
Owner

Hi @artisticat1, has there been any further investigation about this?

I think it's some sort of issue with CodeMirror not receiving key-press events from Android keyboards.

I don't think there's much I can do on my side, except possibly look for a workaround.

@oldkingOK
Copy link

oldkingOK commented Mar 4, 2023

Hi @Deadbush225 ,I found a solution.
When a key on the keyboard is clicked , the Obsidian can't detect key exactly because of IME (means Input-Method Editor) which almost every common keyboard app has.
(See event.key = Unidentified, event.keyCode = 229 #14512 for more information)
Only when we use some unusual keyboard apps without IME can the obsidian detect the exact key, the only one I know of which is "Game Keyboard+", but this one can't be used to type any letter, so we need a physical keyboard to do it.

Specific methods are as follows:

  1. Download ,install and start "Game Keyboard+" app on mobile.
  2. Follow the instruction Step 1 2 and 3.
  3. Click "Custom & Test" and delete all keys because we don't need them.
  4. Connect the physical keyboard to the mobile.
  5. Go to Obsidian and have a try.
    Screenrecorder

(This solution will be better if someone found a common keyboard without IME)
I'm a novice in writing English sentences and using Obsidian, any suggestions are welcome.

@pikatwinky
Copy link

Has anybody found a workaround to this?

@TomBPotochek
Copy link

TomBPotochek commented Aug 30, 2023

@pikatwinky it is kinda working for me. I'm using codeboard. I believe the problem was partly solved when obsidian migrated to codemirror6 but I'm wildly guessing.
However, some snippets I'm not able to get to work. For example "x/y [tab key]" doesn't replace it with \frac{x}{y} but simply inserts a tab or tabs out of the equation. It seems that codemirror still reports Unidentified for special keys like / due to the IME.

edit: actually, it reports correctly now as /, yet it still doesn't work in obsidian.

@TomBPotochek
Copy link

@oldkingOK have you tried using codeboard keyboard? It almost works perfectly but I haven't had any luck with autofractions for example. Codemirror seems to correctly identify the keypresses like / and Tab key despite it not working (I tried it in codemirror.net/try).

@henusys
Copy link

henusys commented Sep 7, 2023

latex suite is a great plugin, but unfortunately it doesn't work on mobile. Are you considering adding mobile support when using IME input methods such as Gboard. Thank you very much. @artisticat1

@oldkingOK
Copy link

@TomBPotochek Sorry for the late reply. I just try it. It's quite strange that the physical keyboard works well with autofractions while the codeboard doesn't work. The reason might be the symbol "/" on the codeboard can be customized, which probably means that only symbols on codeboard use IME.
I have forked gazlaws-dev/codeboard and plan to working on it for a few days. Thank you very much!

@oldkingOK
Copy link

oldkingOK commented Sep 9, 2023

@TomBPotochek Finished, click here to download and have a try.

Edit: This repository was accidentally deleted by me, you can find the download link in the comments below.

Screenrecorder-2023-09-09-15-26-56-111.gif

@TomBPotochek
Copy link

TomBPotochek commented Sep 9, 2023

@oldkingOK great, it's working! I see it was a fairly simple change. I would not have known.

Now this just needs to be done for the other symbols and the problem is solved completely (eg. << expand to \ll, a snippet I use that expands a*b to a \cdot b, etc).
I might add it to your repo as a PR ...If I can figure out how to build an android app in my computer 😵

One small thing I've noticed is that now the _ underscore snippet doesn't expand to _{} that for whatever reason did work with the original codeBoard keyboard.

@pikatwinky
Copy link

pikatwinky commented Sep 12, 2023

@TomBPotochek you're a lifesaver, thanks for the suggestion about using codeboard.

@oldkingOK Thank you so much for sharing that build of the app

It's such a shame that that keyboard doesn´t recieve support anymore, i hope it doesn't break very soon.

@artisticat1
Copy link
Owner

It should be possible to handle IME input - for reference, here's how the vim CM6 plugin handles it. Any PRs for this would be welcome.

@artisticat1
Copy link
Owner

Thanks for the helpful advice! I have modified some code and it works well with my device with system default keyboard using 'letter mode', but for some unknown reason there're still some bugs using 'word mode'. It still needs to be test and debug.

Great! Feel free to open a PR to discuss. I don't have an android device, so I can't help debug very much. What do you mean by "word mode"?

@oldkingOK
Copy link

Thanks for the helpful advice! I have modified some code and it works well with my device with system default keyboard using 'letter mode', but for some unknown reason there're still some bugs using 'word mode'. It still needs to be test and debug.

Great! Feel free to open a PR to discuss. I don't have an android device, so I can't help debug very much. What do you mean by "word mode"?

Sorry for my improper description. The "word mode" is a function that the keyboard can give word suggestions after every key input like the screenshot below.

Screenshot_2023-09-16-23-53-51-839_com.github.android.png

@henusys
Copy link

henusys commented Sep 16, 2023

@oldkingOK ,Yes,It works, but the 'tab' key is does't work when using the external keyboard.

@oldkingOK
Copy link

@henusys , the 'tab' key work fine with my external keyboard.

  • Can you give more details about it? such as Android version, external keyboard brand and model, system default keyboard etc.
  • It would be quite helpful if you can provide a screen record or a more detailed description such as how the cursor moves after tab etc.
  • Could you install the debug version I just compile and this dev tools plugin (https://github.com/KjellConnelly/obsidian-dev-tools) ? This will give us access to a console on mobile. After enabling the plugin, open a console using the Command palette. Type something and 'Tab' then screenshot the output in the console.

@henusys
Copy link

henusys commented Sep 17, 2023

Android version is MIUI 12.5.2,
IME: sougou
External keyboard: LEICKE

If I use the codeboard input method, everything works well. But when using sougou input, '\alpha' '\beta' '\frac' and so on could be triggered well, while for the triggered '\frac{}{}' the tab key just reponse the tab and isn't move the cursor to the next brace.

@oldkingOK
Copy link

oldkingOK commented Sep 17, 2023

@henusys ,It works well with my devices,
Android version is MIUI 14.0.2
IME: sogou
External keyboard: INPHIC

  • Are you using the default snippets?
  • The external keyboard might need switch to "android mode" ( press Fn + W )

If it still doesn't work, I will appreciate it if you could help me debug through the way above.

@henusys
Copy link

henusys commented Sep 17, 2023

yes,thank you very much. I test it as follows:
codeboard input method type show this:
6c6c802e192f706edfc10002b7bacc2

sogou input method type show this:
777622cedd992e6d219f91b42b89803

The obsidian mobile version is V1.4.8

@oldkingOK
Copy link

@henusys Thanks! It seems that the app recognizes the tab as a text '\t' instead of a key. I have edited and compiled a new one, you could have a try.
If it still doesn't work, screenshot the console output again.

@henusys
Copy link

henusys commented Sep 17, 2023

Yes I test it just now. once I type 'mk' or 'dm' to trigger the math mode, the error console will appear similar message as follows:

"(http://localhost/app.js:1:490958)at pc
(http://localhost/app.js:1 :477936)at e.flush(http://localhost/app.js:1:486330)
at MutationObserver .<anonymous>(http://localhost/app.js :1:479128)" 

and

"Unidentified Key detected". At this time the tab key will be failure. 

But if I quit the current edite, and then directly select to edit the mathematical formula by touch screen, not use 'mk' to trigger math mode, the error message will not appear and tab key also working well.

@oldkingOK
Copy link

oldkingOK commented Sep 17, 2023

@henusys Thats a little strange, is there any messages like

Get text "xxx" from.. to..

after tab key pressed?

@henusys
Copy link

henusys commented Sep 17, 2023

Yes it have! May be, I got the reason why, if I using the MIUI custom Sogou input method isn't the latest Sougou app, it will be work well.
But I confused that there is an error message every time latex suite triggered. just like this
03d360afbc7e5d40b131aad6f2d7b53

@oldkingOK
Copy link

oldkingOK commented Sep 17, 2023

Yes it have! May be, I got the reason why, if I using the MIUI custom Sogou input method isn't the latest Sougou app, it will be work well. But I confused that there is an error message every time latex suite triggered. just like this.

@henusys ,So, it means that the latest Sogou keyboard will cause problems while the sogou keyboard custemized for MIUI works fine?

But I confused that there is an error message every time latex suite triggered. just like this.

Yes, I have noticed that and plan to figure it out after solving other main issues.

@henusys
Copy link

henusys commented Sep 17, 2023

Yes you are right, thank you very much.

@oldkingOK
Copy link

You're welcome. And thanks for your testing.

@IEatCodeDaily
Copy link

Having similar problem. Using Obsidian 1.4.9 on Samsung Galaxy Tab S6 running Android 12 and oneUI 4.1.1.

Snippets doesn't work at all on Gboard and Swiftkey. The weird thing is when I use Samsung Keyboard. Any snippet is injected twice with some weird behaviour on how $0 is handled as shown below.
Screenshot_20231002_121612_Obsidian

I can't try codeboard because it's apparently not compatible with my tablet.
I'll try it on my phone. Will update on it later.

@IEatCodeDaily
Copy link

IEatCodeDaily commented Oct 2, 2023

Okay apparently the "bug" on the Samsung Keyboard I've shown above happens when make.md plugin is enabled.
Now I don't know what I should do...
Do I make an issue for a bug here or in make.md?

This bug only happen on mobile. Obsidian on my PC doesn't have this problem at all.

@awsharif
Copy link

awsharif commented Oct 2, 2023

HI @IEatCodeDaily,

I cannot seem to get LaTeX suite working with a similar arrangements - I am on One UI 5.1 on a Z Fold 4 using stock samsung keyboard. Could you share your settings for the samsung keyboard?

Thanks!

@IEatCodeDaily
Copy link

Ah sorry, I forgot to mention that I'm using the physical keyboard. Without the physical keyboard I'm also unable to get LaTeX suite working no matter what.

@ghost
Copy link

ghost commented Oct 11, 2023

I have also just started getting this issue. It used to work fine on my Samsung galaxy tab s8. However it stopped working recently (i believe after i updated the os).
Upon disabling the predictive text feature in Samsung keyboard in settings the plugin works fine as well as other obsidian features.

Not sure if this helps but it works as a temporary solution.

@JavenQvQ
Copy link

JavenQvQ commented Nov 3, 2024

完成后,单击此处下载并尝试。Screenrecorder-2023-09-09-15-26-56-111.gif Screenrecorder-2023-09-09-15-26-56-111.gif

这个链接失效了,请问现在还有解决方法吗

@pikatwinky
Copy link

@JavenQvQ Here is the file, its the same he uploaded. It seems he just deleted his repo
app-signed.zip

@johnsidi77
Copy link

johnsidi77 commented Dec 9, 2024

I have a TCL NEXTPaper 14 Android tablet. After much time, experimentation, and frustration, I finally managed to activate my snippets from an external keyboard using the Android app Unexpected Keyboard. The Hacker's Keyboard, which I use on my Motorola phone (Android 12), did not work!

Additionally, I encountered the issue that Google does not provide an option to uninstall or deactivate the Gboard keyboard on Android 14. Unexpectedly, the app Keyboard Switcher allowed me to do deactivate it!

As a result, the plugin now works just fine with an external keyboard. However, the snippets still cannot be expanded using the virtual keyboard.

oldkingOK added a commit to oldkingOK/obsidian-latex-suite that referenced this issue Dec 10, 2024
@oldkingOK
Copy link

oldkingOK commented Dec 10, 2024

I have been using Latex-Suite for more than a year now and it helps a lot, thanks a lot to all the maintainers of this repo.

I've updated the previous code and after testing with my device, the following keyboards have been supported nicely, including virtual and external keyboards, and there is no need to turn off the word completion.

  • Gboard
  • Sogou keyboard, including MIUI version and general version
  • MS Swift

You can try the plugin I compiled at Releases/1.9.7-dev, I would like to get feedback from you guys on testing it :)

Important: You need to turn off Don't trigger snippets when IME is active at the bottom of the Latex Suite settings. Because most mobile devices have IME-based input, Latex Suite cannot be triggered without turning it off.

example.gif

@oldkingOK
Copy link

Hi @johnsidi77 , I only have two android device and my code still needs more testing, can you try it? I'd appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests