Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Flick button keyboard.
-
@cvp said in Flick button keyboard.:
@shinya-ta said
When you select text with the flick input button, if it is out of the frame, you don't enter text
Is that not normal? Out of the frame ==> no blue keys ==> no text entered
It's certainly normal, but if you can't recognize the sound at least, people who can't see won't know where to stop their fingers.
-
@shinya-ta ok, understood. But I want to let sound problems for the end, please. Let us first solve all other problems.
-
@cvp said in Flick button keyboard.:
@shinya-ta said
I can't convert Kanji that I often use.
I try to understand because かんじ is in the db but if I type it as かんじ which is not in the db.
And I don't see the differenceCan I insert new Kanji?
-
@shinya-ta said
I can't convert Kanji that I often use.
Could you test if these not working conversions do not always contain Hirgana letters with an accent, like じ
I've found that じ only contains 1 character but when I type the base Hirgana letter followed by the accent key, the じ contains 2 characters and that could explain that the script can't convert it...
Then, I will solve that but when is another question.Try
t1 = "じ" t2 = "じ" print(len(t1),len(t2))
-
@shinya-ta said
Can I insert new Kanji?
Yes, but this is not the problem, see my just previous post to understand.
I'm sorry, but I have to stop now, perhaps at the end of the day (my time, your night) -
@shinya-ta said
I can't convert Kanji that I often use.
You could test conversion of your usual texts with this little script, to store in the same folder as your HiraganaToKanji.db file.
Of corse, do not use my keyboard to type your text but a standard keyboard.
If conversion works and not in the keyboard, that could mean that the keyboard script has a bug. If it does not work, it means that the Hirgana text is not in the db and can't be converted as it.
You can name itTest Hiragana_to_Kanji db.py
import sqlite3 import ui conn = sqlite3.connect("HiraganaToKanji.db",check_same_thread=False) cursor = conn.cursor() v = ui.View() v.frame = (0,0,400,400) v.name = 'Test Hiragana_to_Kanji.db' class MyTextFieldDelegate (): def textfield_should_return(textfield): cursor.execute( 'select hiragana, kanji from Hiragana_to_Kanji where hiragana = ?', (textfield.text, )) t = '' for row in cursor: t = t + row[1] + '\n' textfield.superview['tv'].text = t textfield.end_editing() return True tf = ui.TextField() tf.frame = (10,10,380,32) tf.delegate = MyTextFieldDelegate v.add_subview(tf) tv =ui.TextView(name='tv') tv.frame = (10,50,380,340) tv.background_color = 'white' tv.editable = False v.add_subview(tv) v.present('sheet') v.wait_modal() conn.close()
-
@cvp said
@shinya-ta said
I can't convert Kanji that I often use.
Could you test if these not working conversions do not always contain Hirgana letters with an accent, like じ
I've found that じ only contains 1 character but when I type the base Hirgana letter followed by the accent key, the じ contains 2 characters and that could explain that the script can't convert it...
Then, I will solve that but when is another question.Try
t1 = "じ" t2 = "じ" print(len(t1),len(t2))
Sorry, I don't understand what this means.
-
@cvp said in Flick button keyboard.:
@shinya-ta said
I can't convert Kanji that I often use.
You could test conversion of your usual texts with this little script, to store in the same folder as your HiraganaToKanji.db file.
Of corse, do not use my keyboard to type your text but a standard keyboard.
If conversion works and not in the keyboard, that could mean that the keyboard script has a bug. If it does not work, it means that the Hirgana text is not in the db and can't be converted as it.
You can name itTest Hiragana_to_Kanji db.py
import sqlite3 import ui conn = sqlite3.connect("HiraganaToKanji.db",check_same_thread=False) cursor = conn.cursor() v = ui.View() v.frame = (0,0,400,400) v.name = 'Test Hiragana_to_Kanji.db' class MyTextFieldDelegate (): def textfield_should_return(textfield): cursor.execute( 'select hiragana, kanji from Hiragana_to_Kanji where hiragana = ?', (textfield.text, )) t = '' for row in cursor: t = t + row[1] + '\n' textfield.superview['tv'].text = t textfield.end_editing() return True tf = ui.TextField() tf.frame = (10,10,380,32) tf.delegate = MyTextFieldDelegate v.add_subview(tf) tv =ui.TextView(name='tv') tv.frame = (10,50,380,340) tv.background_color = 'white' tv.editable = False v.add_subview(tv) v.present('sheet') v.wait_modal() conn.close()
In the text field, I could write characters and convert them.
There is no cursor in text view, so I can't write anything. -
@shinya-ta said
In the text field, I could write characters and convert them.
There is no cursor in text view, so I can't write anything.Normal: the TextField is an input field to type your Hirgana text and the TextView is an output field to show the result of the conversion
-
@shinya-ta said
Sorry, I don't understand what this means.
Forget it. You can test the conversion with my little script.
-
This post is deleted! -
@cvp
It has been converted. -
@shinya-ta version
00.23
is available with- modifications
- long press minimal duration = 0.05 instead of 0.5 second
- correction of bugs
- emoji of more than one character, like (笑), generated only first one
- after tapping the "small keys" button and returning to the original keyboard,
the color button has changed - when adding the
゙
accent, do not append it to the character but replace the
character by a new one
that will allow text like かんじ to be recognized by conversion
https://raw.githubusercontent.com/cvpe/Pythonista-scripts/master/Emojis Keyboard.py
- modifications
-
Wonderful.
Kanji conversion is perfect.
You are a genius after all.I'm sorry, but we need to make some corrections.
1.I want you to further shorten the time for flick input.(The moment you touch it, it's okay.)
2.After moving to a lower case page, the Back button disappeared.
3.The colors of the kanji buttons are reversed.(Gray before conversion and blue after conversion.)
-
You are a genius after all.
If it was true, you should not find so much errors
I want you to further shorten the time for flick input.(The moment you touch it, it's okay.)
I'll try with a tap with holding the finger down, thus without long press
After moving to a lower case page, the Back button disappeared.
You're right, I guess that I have broken something
The colors of the kanji buttons are reversed.(Gray before conversion and blue after conversion.)
To be checked, not sure that I understand correctly
No time this morning, I just leave home at 08:00 am (my time) for new medical exams, thus perhaps in the evening (for me), and no new version for you before tomorrow (your time), sorry for the delay
-
@cvp
It's okay. Please give priority to your body.
I'm really worried about you. -
@shinya-ta I'm in a waiting room, I don't understand this bug
The colors of the kanji buttons are reversed.(Gray before conversion and blue after conversion.)
You also said
-
1.The "read all" button doesn't read everything. If a new line, it doesn't read from the beginning.
And if a sentence is too long, you don't read it out from the beginning and start in the middle.2.Similarly, the read to cursor button does not read from the beginning if it is a new line.
And if the sentences are too long, you don't read them out from the beginning and start in the middle.
You know that a keyboard is not an app and thus I can't get the whole TextField or TextView to which this keyboard is related. I only can use keyboard Pythonista module. And to read a text, I need to use keyboard methods like keyboard.get_input_context() and if you read the Pythonista doc, you get
Warning If more than two lines, or about 1000 characters are selected,
this function’s return value will be truncated in the middle.
Unfortunately, it is not technically possible to prevent this (it’s a system limitation),
and it’s also not possible to detect the truncation.
You should typically not use the return value of this function to replace selected text,
if it contains more than one line.where you can see that I can't get whole text and surely not what you hope.
-
-
@cvp
It is gray before conversion, changes to blue when you enter characters, and returns to gray when conversion is completed. -
This post is deleted! -
@shinya-ta ok, I understand.
It is gray before conversion, changes to blue when you enter characters, and returns to gray when conversion is completed.
What I want to show is that the "漢字" conversion key is disabled (gray) if no Hirgana nor digit exists in the temporary storage, disabled because nothing to convert.
As soon you have something in this temporary storage, the key becomes enabled (thus blue) and you can tap it to convert.
After conversion, the temporary storage is emptied , thus I disable the key and it becomes gray.
Don't you like this usual process?