1)起因:一个触摸屏的软件基本搞定,中间有个模糊查询的功能,就是关键字查询,基本是查询中文,原来想的很简单,只要在系统的输入法上按出软件盘就可以搞定,后来客户反映,因为键很小,很难点上,没有办法,上帝的命令,而且我觉得这个要求还是比较合理的。2)初步设想:画一个“巨大”的软键盘。然后取得每次点击位置就可以知道用户在上面敲的是什么字母了,3)问题:如果用户想打个“我”字出来,在软键盘上敲了个“w”+“o”+空格,我如何能给出智能abc的中文选择呢??或者我的思路就是不正确的,应该用别的什么方法????请牛人指点一二,万分感谢!!!!!!!!!!!!

解决方案 »

  1.   

    自己开发软键盘,盒子上有麻子用delphi改写的系统软键盘的原码,可参考一下
      

  2.   

    我原来做过,就是自己画的键盘,然后通过扑捉键盘信息来处理。
    方法是:1:根据键盘布局或实际需要的放置n个button,用n个button来做每个字母的输入处理。
            2:要有个字库;包括 汉子及相应的拼音。
            3:通过输入的字母到字库中查询相同拼音的汉子(可以模糊查询)
            4:将查询结果显示在一个列表中,然后通过点击列表中的字获得最终的输入汉字。
    这个方法比较笨,但是很管用。做起来也不是很难。
      

  3.   

    /*-1.-获得汉字字符串的首字母
       根据大力的贴子改成.将大力的两个函数合并成了一个函数.
       可以应用于助记码的查询
    --*/
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fGetPy]') and xtype in (N'FN', N'IF', N'TF'))
    drop function [dbo].[fGetPy]
    GO
    --创建取拼音函数
    create function fGetPy(@Str varchar(500)='')
    returns varchar(500)
    as
    begin
     declare @strlen int,@return varchar(500),@ii int
     declare @n int,@c char(1),@chn nchar(1)
     select @strlen=len(@str),@return='',@ii=0
     set @ii=0
     while @ii<@strlen
     begin
      select @ii=@ii+1,@n=63,@chn=substring(@str,@ii,1)
      if @chn>'z'
      select @n = @n +1
         ,@c = case chn when @chn then char(@n) else @c end
       from(
        select top 27 * from (
         select chn = '吖'
         union all select '八'
         union all select '嚓'
         union all select '咑'
         union all select '妸'
         union all select '发'
         union all select '旮'
         union all select '铪'
         union all select '丌'  --because have no 'i'
         union all select '丌'
         union all select '咔'
         union all select '垃'
         union all select '嘸'
         union all select '拏'
         union all select '噢'
         union all select '妑'
         union all select '七'
         union all select '呥'
         union all select '仨'
         union all select '他'
         union all select '屲'  --no 'u'
         union all select '屲'  --no 'v'
         union all select '屲'
         union all select '夕'
         union all select '丫'
         union all select '帀'
         union all select @chn) as a
        order by chn COLLATE Chinese_PRC_CI_AS 
       ) as b
      else set @c='a'
      set @return=@return+@c
     end
     return(@return)
    end
    go
    --测试
    select dbo.fgetpy('青藏高原') as 东莞市,dbo.fgetpy('ab中c国人') as 中国人
    --删除拼音函数
    drop function fgetpy
      

  4.   

    自己做字库,算了,如果没有更好的方法,就不做了,太麻烦了,
    不过哪个朋友做出来真的是一劳永逸的事情,
    以后真有朋友做的话,在系统智能abc中有个文件是字库,打开一看就可以发现,做字库的时候不用每个字都自己找直接可以用,
    如果没有还没有更好的方法就散分了,谢谢大家!!!!!!!!!!!
      

  5.   

    接分了,MS自带的软键盘有源码的,你可以上网上搜一下,那个的话,你只要把界面调大一点就行了.以前公司也做一个款查询软件,用的就是MS的源码改的.现在忘记网址了