/kivy

Open source UI framework written in Python, running on Windows, Linux, OS X, Android and iOS

KivyのTextInputでIMEを使用するためのコード

インストール方法

kivy-textime.zipをダウンロードして保存してください。

検証環境はPython3.6でOSはwindows10の64bit環境です。

※未検証ですが恐らくmac環境でも動作すると思います。

Use development Kivy(Kivyの開発バージョンを使用する)のやり方を基本にしています。

  1. Visual C++ 2015 BuildToolsをダウンロードしてインストールします。

  2. 環境変数PathにインストールしたBuildToolsのパスを通します。例は以下

C:\Program Files\Microsoft VS Code\bin
  1. コマンドプロンプト[cmd]を立ち上げます。

  2. 環境変数を設定します

set USE_SDL2=1
set USE_GSTREAMER=1

※PowerShellだと以下になります

$env:USE_SDL2 = 1
$env:USE_GSTREAMER = 1
  1. PiPとwhileを最新にします
python -m pip install --upgrade pip wheel setuptools
  1. 依存関係をインストールします
python -m pip install cython docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew kivy.deps.gstreamer kivy.deps.glew_dev kivy.deps.sdl2_dev kivy.deps.gstreamer_dev
  1. Kivyのビルドをします zipを展開した、kivy-masterの直下に移動してビルドします
python -m pip install .

8.Kivyを実行します kivy_textedit_sampleを実行(main.py)して起動時のログを確認してください。

※TextとWindowのでProviderがSDL2になっていることを必ず確認してください。Pygameが表示されている場合は環境変数の設定がおかしいので見直してください。

[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [OSC         ] using <thread> for socket
[INFO   ] [Window      ] Provider: sdl2

この状態で実行すると、TextinputIMEの隣のラベルに全角(日本語入力)で未確定の文字(Enterを入力する前)の文字が表示されます。

注意事項としては、スペースキーを押して変換はできますが変換候補の一覧は表示されません。また入力ですが一度に入力できる文字数は最大15文字までです。

Kivyで日本語入力ができない問題の詳しい説明はリンク先の記事を見てみてください。


Kivy

Innovative user interfaces made easy.

Kivy is an open source, cross-platform Python framework for the development of applications that make use of innovative, multi-touch user interfaces. The aim is to allow for quick and easy interaction design and rapid prototyping whilst making your code reusable and deployable.

Kivy is written in Python and Cython, based on OpenGL ES 2, supports various input devices and has an extensive widget library. With the same codebase, you can target Windows, OS X, Linux, Android and iOS. All Kivy widgets are built with multitouch support.

Kivy is MIT licensed, actively developed by a great community and is supported by many projects managed by the Kivy Organization.

Coverage Status Build Status Build status Bountysource

Installation, Documentation and Examples

Extensive installation instructions as well as tutorials and general documentation, including an API reference, can be found at https://kivy.org/docs. A PDF version is also available.

Kivy ships with many examples which can be found in the examples folder.

Support

If you need assistance, you can ask for help on our mailing list:

We also have an IRC channel:

  • Server : irc.freenode.net
  • Port : 6667, 6697 (SSL only)
  • Channel : #kivy
  • Web client : WebChat

Contributing

We love pull requests and discussing novel ideas. Check out our contribution guide and feel free to improve Kivy.

The following mailing list and IRC channel are used exclusively for discussions about developing the Kivy framework and its sister projects:

IRC channel:

  • Server : irc.freenode.net
  • Port : 6667, 6697 (SSL only)
  • Channel : #kivy-dev
  • Web client : WebChat

Sister projects

  • Buildozer: generic Python packager for Android and iOS.
  • Plyer: platform-independent Python wrapper for platform-dependent APIs.
  • Pyjnius: dynamic access to the Java/Android API from Python.
  • Pyobjus: dynamic access to the Objective-C/iOS API from Python.
  • Python for Android: toolchain for building and packaging Python applications for Android.
  • Kivy iOS: toolchain for building and packaging Kivy applications for iOS.
  • Audiostream: library for direct access to the microphone and speaker.
  • Kivy Designer: UI designer for Kivy.
  • KivEnt: entity-based game engine for Kivy.
  • Garden: widgets and libraries created and maintained by users.

Licenses

  • Kivy is released under the terms of the MIT License. Please refer to the LICENSE file.
  • The provided fonts Roboto and Roboto Mono are licensed and distributed under the terms of the Apache License, Version 2.0. The DejaVuSans (used for the virtual keyboard) license can be viewed here.
  • The current UI design has been adapted from Moblintouch theme's SVGs and is licensed under the terms of the LGPLv2.1.