cht電腦資訊gcingcin wish
adm Find login register

gcin 在Ubuntu 12.04 環境下與 Freepascal 的 Lazarus IDE 有衝突

swwei
joined: 2009-11-25
posted: 51
promoted:
bookmarked:
1subject: gcin 在Ubuntu 12.04 環境下與 Freepascal 的 Lazarus IDE 有衝突Promote 0 Bookmark 02013-06-02quote  

先聲明這個問題可能並非出在gcin,而是出在Lazarus。不過eliu兄如果有興趣與時間可以看看,探討一下原因。

Object Pascal這個程式語言在Delphi IDE 的關聯下可以說是老兵不死。個人使用Delphi有很長一段時間,

實在是很不錯的東西。在開源碼的世界也有Freepascal 與 Lazarus 與之對應。Freepascal的計劃也是老牌子,

而Lazarus也試著與Delphi看齊,可以說相當接近了。如果gcin與Lazarus 相容,應該是很好的事情。

Borland公司(現在改名叫Embarcadero) 本來也有 Linux版的Delphi 叫 Kylix,不過中止很久了。

 

eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
2subject: Promote 0 Bookmark 02013-06-02quote  

先用 copy/paste ?

swwei
joined: 2009-11-25
posted: 51
promoted:
bookmarked:
3subject: Promote 0 Bookmark 02013-06-02quote  

eliu

先用 copy/paste ?

我寫了一個Form 裏面有文字框的程式,是可以copy/paste。

Lazarus有簡體中文網站,所以對岸的朋友可能有解決之道,或可參考。

剛剛改用ibus的拼音來試所寫的簡單文字框程式,勉強可用。

Any way, 如eliu兄有時間不妨看看。

謝謝

swwei
joined: 2009-11-25
posted: 51
promoted:
bookmarked:
4subject: Promote 0 Bookmark 02013-08-31quote  

在ubuntu的網站有討論這問題,但也僅止於「討論」而已

http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?viewmode=flat&type=&topic_id=18227&forum=12

請問eliu兄,應用程式能否可知道目前的input-mode?

如果可以那麼要改的是lazarus的元件,而不是gcin。

 

 

 

 

 

eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
5subject: Promote 0 Bookmark 02013-08-31quote  

swwei
請問eliu兄,應用程式能否可知道目前的input-mode?

不需要知道,一般是收到 key event 後 AP 根據自己的狀態決定是否要送給 gcin 處理,如果不送給 gcin 處理,就等於是英數狀態。

不清楚 lazarus 是用什麼,如果是 gtk,AP 是用這個 API 把 key event 送給 gcin 處理

gboolean            gtk_im_context_filter_keypress      (GtkIMContext *context,   GdkEventKey *event);
swwei
joined: 2009-11-25
posted: 51
promoted:
bookmarked:
6subject: Promote 0 Bookmark 02013-08-31quote  

eliu

 

不需要知道,一般是收到 key event 後 AP 根據自己的狀態決定是否要送給 gcin 處理,如果不送給 gcin 處理,就等於是英數狀態。

不清楚 lazarus 是用什麼,如果是 gtk,AP 是用這個 API 把 key event 送給 gcin 處理

gboolean            gtk_im_context_filter_keypress      (GtkIMContext *context,   GdkEventKey *event);

Lazarus 有對等的gtk2 library ,用Pascal表達,

個人認為這不相容的問題出在lazarus ide 元件沒處理好key event

但也有人不這麼想

不知eliu兄能否到上述ubuntu的討論網頁看一下?想知道您的看法。

eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
7subject: Promote 0 Bookmark 02013-08-31quote  

用 gcin 的 debug log 看,

ubuntu 13.04 lazarus 0.9.30.4-4 每按一次鍵就 call

gtk_im_context_reset

這是不對的,這會造成清除輸入&編輯區的內容。所以 gcin 的行為是閃一下,輸入一下就被清除。

ibus 可能沒有做清除的動作,所以會 ok。但是這可能在某些程式造成了按鍵或編輯區內容殘留的問題。例如 click mouse 移動 cursor 的時候。

gtk_im_context_reset
Notify the input method that a change such as a change in cursor position has been made. This will typically cause the input method to clear the preedit state.

edited: 1
swwei
joined: 2009-11-25
posted: 51
promoted:
bookmarked:
8subject: Promote 0 Bookmark 02013-09-01quote  

eliu

用 gcin 的 debug log 看,

ubuntu 13.04 lazarus 0.9.30.4-4 每按一次鍵就 call

gtk_im_context_reset

這是不對的,這會造成清除輸入&編輯區的內容。所以 gcin 的行為是閃一下,輸入一下就被清除。

ibus 可能沒有做清除的動作,所以會 ok。但是這可能在某些程式造成了按鍵或編輯區內容殘留的問題。例如 click mouse 移動 cursor 的時候。

 

您的意思是說ibus並非使用gtk, 所以當Lazarus  calls  gtk_im_context_reset 對ibus不起作用?

另外,邏輯上來說,如果 Lazarus 不應該 每按一次鍵就 call gtk_im_context_reset

正確的方式應該如何?

eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
9subject: Promote 0 Bookmark 02013-09-01quote  

swwei
您的意思是說ibus並非使用gtk, 所以當Lazarus  calls  gtk_im_context_reset 對ibus不起作用?

我的意思是 ibus 可能忽略 gtk_im_context_reset。記得 ibus 的 ui 也是用 gtk,但是這與此問題無關。

另外,邏輯上來說,如果 Lazarus 不應該 每按一次鍵就 call gtk_im_context_reset

正確的方式應該如何?

gtk_im_context_reset 一般是使用者 click mouse 把 cursor 移到別處,這時候正在輸入的內容就沒意義了,所以就清除。

key event 處理的流程中根本就不應該出現 gtk_im_context_reset,應該是程式寫錯吧。

edited: 1

cht電腦資訊gcingcin wish
adm Find login register
views:25087