Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity Plugin for turning on/off IME

Discussion in 'Made With Unity' started by lubo3d, Mar 24, 2011.

  1. lubo3d

    lubo3d

    Joined:
    Mar 23, 2011
    Posts:
    75
    For all the OpenGL applications including Unity, if some edit box needs IME to get charactors, the keyboard input will be intercepted until IME is turned off manually.

    This plugin is to fix this problem by turning on/off the IME automatically in Unity scripts.
    Simply by calling UnityWinUtility.EnableIME(bool bEnable).

    The only defact is it only supports Unity Window Standalone application.

    See the demo and project source in the attachment.

    UnityWinUtiliyDemo

    UnityWinUtilitySource
     
    Last edited: Mar 24, 2011
  2. lubo3d

    lubo3d

    Joined:
    Mar 23, 2011
    Posts:
    75
    This plugin also support hardware cursor.
    Code (csharp):
    1.  
    2.  
    3. public class UnityWinUtility
    4. {
    5.     [DllImport("UnityWinUtility")]
    6.     public static extern void EnableIME(bool bEnable);
    7.    
    8.     [DllImport("UnityWinUtility")]
    9.     public static extern void EnableCustomCursor(bool bEnable);
    10.    
    11.     [DllImport("UnityWinUtility")]
    12.     public static extern void RegistCursor(int nCursorID, string strFilename);
    13.  
    14.     [DllImport("UnityWinUtility")]
    15.     public static extern void ApplyCursor(int  nCursorID);
    16. }
    17.  
    Just check it out!
     
  3. liverolA

    liverolA

    Joined:
    Feb 10, 2009
    Posts:
    347
    Nice work,Thanks for sharing.
     
  4. xfingerx

    xfingerx

    Joined:
    Feb 12, 2011
    Posts:
    4
    great!
     
  5. CodeGize

    CodeGize

    Joined:
    Feb 11, 2015
    Posts:
    3
    great,but the link is lost.can you give a new link?